Solved

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

Posted on 2009-04-05
2
489 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
Comment Utility
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
Comment Utility
Thank you very much!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
oracle query help 18 74
sQL pivot 9 39
PL/SQL - Leading zeros 7 39
Sql to Replace Folderpath string in MS Access Table field 7 13
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

10 Experts available now in Live!

Get 1:1 Help Now