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)
 First & Last day of the yesr

Author  Topic 

veparala
Starting Member

30 Posts

Posted - 2006-10-26 : 16:08:23
Hi

How to get the first and last date ( in terms of mm/dd/yyyy format) of the current year?. Please help me

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-26 : 16:11:13
SELECT '01/01/' + CONVERT(char(4), YEAR(GETDATE()))
SELECT '12/31/' + CONVERT(char(4), YEAR(GETDATE()))

Tara Kizer
Go to Top of Page

veparala
Starting Member

30 Posts

Posted - 2006-10-26 : 16:21:24
THANKS. IT IS WORKING
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-26 : 21:08:45
Not tested

Select DateAdd(year,Datediff(year,0,getdate()),0)
Select DateAdd(year,Datediff(year,-1,getdate()),-1)


Madhivanan

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

- Advertisement -