X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Dateadd For Sales 13 Months Previous, Access 2010    
post Jun 4 2019, 11:18 AM

Posts: 13
Joined: 6-March 14

I use the following as a "where criteria" in a query


This gives me all the sales for last July, 11 months ago

I use
To give all the sales last June, 12 Months ago

What I'm asked for now is the sales for last May, 13 months ago, but I'm absolutely befuddled.
Any help would be greatly appreciated
Go to the top of the page
post Jun 4 2019, 11:35 AM

Posts: 3,578
Joined: 27-February 09

Use DATEADD() one of the arguments is the date you're adding to (so use DATE()) and the other is the number of units, and the last is the unit size
Go to the top of the page
post Jun 4 2019, 11:59 AM

UtterAccess VIP
Posts: 4,752
Joined: 5-June 07
From: UK

yes - you can use this sort of syntax

fromdate = dateadd(todate, months, -13)

then you can use simply

between fromdate and todate in your query.

Dave (Male)

(Gemma was my dog)
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    7th April 2020 - 04:39 AM