Solved

How do I pull information from one month before the current date in MS Access using SQL?

Posted on 2009-04-05
2
490 Views
Last Modified: 2012-05-06
I am using MS Access 2007 and trying to write this query using SQL and do not know how to pull the current date or subtract a month to it.
SELECT SalesNo.SaleNo, SalesNo.CustID, SalesNo.SaleDate

FROM SalesNo

WHERE ??? current date - one month ???

ORDER BY SalesNo.SaleDate;

Open in new window

0
Comment
Question by:jnreinsch
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 24074618
simple:
SELECT SalesNo.SaleNo, SalesNo.CustID, SalesNo.SaleDate
FROM SalesNo
WHERE SalesNo.SaleDate <= DATE()
  AND SalesNo.SaleDate >= DATEADD("m", -1, DATE())
ORDER BY SalesNo.SaleDate;

Open in new window

0
 

Author Closing Comment

by:jnreinsch
ID: 31566910
Thank you very much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now