Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query: Prior Month Date 1

Status
Not open for further replies.

mrpauly

Programmer
May 11, 2001
23
0
0
Hi,

I need help creating a query that pulls all records from the prior month date.

For example, if the report is ran today (Jan 4th) I want all records for December.

Thanks,
Paul
 

something like:

select * from myTable
where datediff(mm, date_column, getdate()) = 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top