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 2005 Forums
 Transact-SQL (2005)
 [Resolved] Get "dayofyear"

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2009-07-09 : 08:14:28
I have a stored procedure where I need to get the day of the year. Not sure about the syntax:

declare @DateFrom datetime
declare @JdeDateFrom int
set @DateFrom = '2008-03-13'

Need to add day of year into the @JdeDateFrom variable.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-09 : 08:17:35


declare @DateFrom datetime
declare @JdeDateFrom int
set @DateFrom = '2008-03-13'
select @JdeDateFrom =datepart(dayofyear,@DateFrom)
select @JdeDateFrom


Madhivanan

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

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2009-07-09 : 08:24:24
Great, thank you.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-09 : 08:25:23
quote:
Originally posted by snufse

Great, thank you.


You are welcome

Madhivanan

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

- Advertisement -