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
 General SQL Server Forums
 New to SQL Server Programming
 Dates

Author  Topic 

BankOfficerHere
Posting Yak Master

124 Posts

Posted - 2008-08-27 : 23:35:07
When I tried this satement:

SELECT DATENAME(month, DATEADD(DAY, DATEDIFF(DAY, '19000107', GETDATE()) / 14 * 14, '19000107') - 1) + ' ' + DATENAME(day, DATEADD(DAY,
DATEDIFF(DAY, '19000107', GETDATE()) / 14 * 14, '19000107') - 1) AS Week4
FROM dbo.Date

I got the result August 23. What I want is August 30. Is that possible? Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-27 : 23:41:48
+ 7 days ?

You have to explain to use what are you trying to do here


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-28 : 02:20:09
quote:
Originally posted by BankOfficerHere

When I tried this satement:

SELECT DATENAME(month, DATEADD(DAY, DATEDIFF(DAY, '19000107', GETDATE()) / 14 * 14, '19000107') - 1) + ' ' + DATENAME(day, DATEADD(DAY,
DATEDIFF(DAY, '19000107', GETDATE()) / 14 * 14, '19000107') - 1) AS Week4
FROM dbo.Date

I got the result August 23. What I want is August 30. Is that possible? Thanks


How do we know what you are doing in this code?

Madhivanan

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

- Advertisement -