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)
 year begin date / End date

Author  Topic 

disha
Starting Member

34 Posts

Posted - 2008-06-05 : 06:37:21
i need syntax to calculate

year begin date and also the year End date

pls help

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-06-05 : 07:19:31
[code]
select
StartOfYear =
dateadd(yy,datediff(yy,0,MyDay),0) ,
EndOfYear =
dateadd(yy,datediff(yy,-1,MyDay),-1)
from
MyTable
[/code]

Start of Time Period Functions:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64755

End Date of Time Period Functions:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64759

More Date/Time Info and Script Links
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64762




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -