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

Need a SQL statement...

Status
Not open for further replies.

Tanya556

Technical User
Apr 5, 2002
34
US
I need a SQL statement that will only show records within two weeks. For instance in a payroll database I want to see total hours for a two week period per employee.

If anyone can help me with this I'd greatly appreciate it.
 
Try this,say your table nameed 'bb' with a column (datetime datatype) called dat

select * from bb where dat >= convert(varchar(14),dateadd(dd,-13,getdate()),101)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top