Date query

simon4amiee

Registered User.
Local time
Today, 17:09
Joined
Jan 3, 2007
Messages
109
How do I return data to show the next 30 days from todays date
 
How do I return data to show the next 30 days from todays date

Try using the DateAdd()( Function and see if thatgets you what you are looking for.
Code:
    DateAdd ( 
        interval, { "d"=Days, etc. }
        number,  { Number of { Intervals } to add }
        date { Starting Date }
        )
 
   DateAdd ( interval, number, date )
 
By setting a Where clause on a date field to Date()+30 should do it.

no was a bit quick there, dateadd function is the way.

JR
 
Last edited:
DateAdd ( interval, number, date ) seems ok but specifically i need to show all dates 30 days from current date (todays date), so that when i run the report I get all records that are coming up!
 
By setting a Where clause on a date field to Date()+30 should do it.

no was a bit quick there, dateadd function is the way.

JR

I believe that either one will resolve the Ops issue, since the original issue was regarsing adding a specific number of days. The main advantage to the DateAdd() Function, is that it provides the flexibility of having intervals other than days.
 
DateAdd ( interval, number, date ) seems ok but specifically i need to show all dates 30 days from current date (todays date), so that when i run the report I get all records that are coming up!

You already know the Start Date, and DateAdd() can get you the End Date. The SQL Between Function can be used to select records that are in the range that you want.
 
you could try this in the criteria of your datefield.

Between (Date()) AND (Date()+30)

It will give you records from today and 30 days ahead.

JR
 

Users who are viewing this thread

Back
Top Bottom