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
 Transact-SQL (2000)
 dates in tsql

Author  Topic 

kemi2299
Starting Member

41 Posts

Posted - 2008-05-23 : 13:06:13
hi,guys

I am really struggling with this statement, could you pls write in tsql pls.

where date_trunc('month',a.month) = (date_trunc('month',edate) - '1 month')

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-23 : 13:31:26
WHERE DATEPART(mm,a.month) = DATEPART(mm,edate) -1
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-23 : 13:31:50
date_trunc is not a valid SQL Server function. What system are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
   

- Advertisement -