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 |
johnjasper
Starting Member
4 Posts |
Posted - 2007-03-01 : 10:51:16
|
Here is a record in my table, the field is called "birthdate"1948-02-27 00:00:00.000When I do left(birthdate,4) I get back something like this:Feb How can I extract the year (1948) from this and why doesn't it come out correctly from my code ? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-01 : 10:58:42
|
when you use left(), the date is implicitly convert to string and for your case, it is implicitly convert to Feb 27, 1948If you need the year :select year(birthdate) KH |
|
|
johnjasper
Starting Member
4 Posts |
Posted - 2007-03-01 : 11:04:27
|
Thank You |
|
|
|
|
|