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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Month -1 in DTS SQL Query Designer

Status
Not open for further replies.

sgp_imported

Technical User
Sep 11, 2001
8
0
0
US
I would like to filter data to get the "last full month" only. How can this be done in DTS?

Thanks!
 
pls can you provide a bit more info. if its just a sql statement you are after to get all records from the previous month (this will give you all June 2003 records) try this

select *
from tablename where datepart(mm,datetimefield)+ datepart(yy,datetimefield)= datepart(mm,getdate()-1) + datepart(yy,getdate())

Matt

Brighton, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top