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.
| Author |
Topic |
|
bhdijkstra
Starting Member
24 Posts |
Posted - 2011-11-06 : 04:53:01
|
| Hi all,I need some help with the following:- i need to know on which day the date of birth this year will fall- i know you can get the dayname by using the datepart(dw, date) as picking up the dayname in the query- what i really want is a kind of CONVERT(VarChar, date, xxx) query to get the following:dayname, date converted full (dd monthname yyyy)Thanks for your help. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-11-06 : 04:57:32
|
[code]declare @date dateselect @date = '1987-06-05'select dateadd(year, year(getdate()) - year(@date), @date)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
bhdijkstra
Starting Member
24 Posts |
Posted - 2011-11-07 : 05:37:53
|
| this is not the solution. anyone else? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-07 : 06:29:51
|
quote: Originally posted by bhdijkstra this is not the solution. anyone else?
why?at least explain what you were expecting instead with some sample data and output.Unless you explain your rules we cant understand what logic you're looking at------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|