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)
 Help

Author  Topic 

PatDeV
Posting Yak Master

197 Posts

Posted - 2006-04-03 : 15:46:09
hi,

I need to run query for the first day of month the today;s date

what should i use for @testdate between Firstdateof month(???) and getdate().

thanks

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2006-04-03 : 15:48:29
(getdate()-day(getdate())+1) = firstDayOfMonth

Corey

Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..."
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-03 : 19:23:35
First Day of Month with Time 00:00
select	dateadd(month, datediff(month, 0, getdate()), 0)





KH

Choice is an illusion, created between those with power, and those without.
Go to Top of Page
   

- Advertisement -