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

In SQL - 2000 For a view I need all the transactions in the past 7 Day 1

Status
Not open for further replies.

shivalisv

Technical User
Jan 13, 2004
9
IN
In SQL Server - 2000 Under Query Analyzer For a view I need all the transactions in the past 7 Days excluding the current Day. I have a field Transaction Date Field in the Database. How Could I extract only those Transactions ?
 
SELECT * FROM Transactions
WHERE TransactionDate >=
DATEADD(DAY, -7, CONVERT(SMALLDATETIME, CONVERT(CHAR(10), GETDATE(), 101)))
AND TransactionDate < CONVERT(SMALLDATETIME, CONVERT(CHAR(10), GETDATE(), 101))

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top