Current month records as of today and Same records as of same day last month

shahiq

Registered User.
Local time
Today, 03:46
Joined
Mar 31, 2007
Messages
29
I am trying to generate a sales report from my SQL database. My management would like to get a report of sales movement which shows sales total current month as of todate and sales totals of last month as of the same day.

for example todate is 2/10/2013, I want the totals of January as of 1/10/2013.

Here follows how the table structure is.
 
attached is a sample table.

thanks
 

Attachments

  • tbb.JPG
    tbb.JPG
    18.8 KB · Views: 229
Kinda late you probably got this fixed already but this should work:
If you go by todays date minus 1 month use: >now()-31 as criteria in a query
otherwise just use the date u want: #01-05-2013#-31
Hope it was something u could use.
Martyn
 
Not all months have 31 days so use Dateadd("m",-1,Date()) and use Date not Now as you don't want times confusing the issue.

Brian
 

Users who are viewing this thread

Back
Top Bottom