Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the statement below.... SE 1

Status
Not open for further replies.

chris6976

Technical User
Mar 4, 2003
28
GB
Using the statement below....

SELECT [Exhibitor].[Exhibitor_Ref], [Exhibitor].[Exhibitor_Name], [Exhibitor].[Tel]
FROM Exhibitor INNER JOIN Booking ON [Exhibitor].[Exhibitor_Ref]=[Booking].[Exhibitor_Ref]
WHERE [Booking].[Booking_Status]=&quot;Provisional&quot; And [Booking].[Date_Inserted]<=DateAdd(&quot;d&quot;,-7,Date());

I wish to compare the dates of Date_Inserted and the range of the system date [Date()] and the preceding 7 days.

This statement seems close to the answer, but doesnt quite work.

Also, if the current date steps back from say the 3rd of the month, will the calendar automatically step the month back too?

Thanks
 
Change the WHERE portion of the SQL to the following:

WHERE [Booking].[Booking_Status]=&quot;Provisional&quot; And [Booking].[Date_Inserted] Between DateAdd(&quot;d&quot;,-7,Date()) and Date());

And yes, ACCESS will perform the correct compensation for crossing over the month including the Leap Year leap from March to Feb. Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top