Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 20th, 2006, 09:50 PM
Authorized User
Points: 146, Level: 2
Points: 146, Level: 2 Points: 146, Level: 2 Points: 146, Level: 2
Activity: 27%
Activity: 27% Activity: 27% Activity: 27%
 
Join Date: Sep 2006
Location: melbourne, VIC, Australia.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default query Current Month, Month+1, Month+2, Month+3

I am trying to generate a report which displays data from an Invoicng Table.
The table contains date time field (as "mmmm\ yyyy")
The table has old data going back more than 12 months plus data which is dated for future invoicing (more than 12 months forward).

I need to generate reporting of future 6 months, and need the report columns to automatically reflect

Current Month
Current Month+1
Current Month+2
etc..

I can use date part to add 1 month, 2 months, 3 months. but run into trouble where the year changes.

Any help would be greatly apprecited.

Dave
Reply With Quote
  #2 (permalink)  
Old September 21st, 2006, 10:37 AM
Friend of Wrox
Points: 3,947, Level: 26
Points: 3,947, Level: 26 Points: 3,947, Level: 26 Points: 3,947, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,150
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Don't use DatePart, use the DateAdd function.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old September 24th, 2006, 08:25 PM
Authorized User
Points: 146, Level: 2
Points: 146, Level: 2 Points: 146, Level: 2 Points: 146, Level: 2
Activity: 27%
Activity: 27% Activity: 27% Activity: 27%
 
Join Date: Sep 2006
Location: melbourne, VIC, Australia.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Greg, I've also now used DateSerial(Year(Date()),Month(Date())+1,0) + 2 + 3 etc and this nis working well.

Thanks again

Dave
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting month name to month number kalyanykk SQL Server 2005 7 August 19th, 2008 10:37 PM
get current month cathiec SQL Language 2 February 23rd, 2006 08:58 AM
Veiw Reports only for current month. Dharam80 Access 54 September 30th, 2005 04:59 PM
Query birthdate by month Batusai Access 2 February 23rd, 2005 12:23 AM
Getting the current month Regornil JSP Basics 1 July 19th, 2004 09:01 PM



All times are GMT -4. The time now is 09:06 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.