Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
  #2 (permalink)  
Old September 21st, 2006, 10:37 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
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
  #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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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


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 09: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 01:23 AM
Getting the current month Regornil JSP Basics 1 July 19th, 2004 09:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.