Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL, show by date

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-10 : 07:41:37
Paul writes "SELECT INVAUDIT_NF.INV_CLASS_CODE, INVAUDIT_NF.INV_CLASS_DESC, INVAUDIT_NF.TRANS_DATE, INVAUDIT_NF.CHANGE_QTY, INVAUDIT_NF.TRANSACTION_CODE, INVAUDIT_NF.TRANS_DESC
FROM INVAUDIT_NF INVAUDIT_NF
WHERE (INVAUDIT_NF.TRANS_DATE>={d '2005-03-01'})

How can I with the above code in MS Query bring up results for the past 3 months from today without having to hard code a date in (as shown above) 3 month before today?

Best Regards Paul"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-10 : 07:50:04
WHERE DateDiff(m,INVAUDIT_NF.TRANS_DATE,Getdate())=3


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -