Query to pre-empt a product expiry date.... (1 Viewer)

VygonDBA

Registered User.
Local time
Today, 05:27
Joined
Oct 24, 2012
Messages
12
***Update:- Just cracked this one by using T-SQL, if anyone needs the solution please just let me know, thanks.***

Hi all, I'm trying to create a query in Access 2010 based on a warranty_expiry field (data type: Date/Time) that will give me all the records where the warranty is due to expire between 90 and 31 days prior to the current days date (I'll then do another to pick up the ones that fall into the 30-0 days catagory afterwards). Needless to say I'm struggling, can anyone assist please?

KR, M
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Today, 00:27
Joined
Jan 23, 2006
Messages
15,394
General query would be along these lines.

SELECT * From YourTableNameGoesHere
WHERE warranty_expiry BETWEEN DateAdd("D",Date,-90) AND DateAdd("D",Date, -31)
 

VygonDBA

Registered User.
Local time
Today, 05:27
Joined
Oct 24, 2012
Messages
12
General query would be along these lines.

SELECT * From YourTableNameGoesHere
WHERE warranty_expiry BETWEEN DateAdd("D",Date,-90) AND DateAdd("D",Date, -31)

That's the basis of it, thanks for your response. :D
 

Users who are viewing this thread

Top Bottom