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 |
|
keithc1
Yak Posting Veteran
88 Posts |
Posted - 2004-06-11 : 00:59:37
|
| Hey I seen this in a profile hereand person has this code to tell there age I beleive. What is the number "22211.0028" referring to?Select Datediff(dd,convert(datetime,22211.0028),Getdate())/365.00 As YearsKeithc MCSE MCSA |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-06-11 : 01:08:43
|
| Their birth date, if you convert the date to a decimal1960-10-24 00:04:01.917 |
 |
|
|
keithc1
Yak Posting Veteran
88 Posts |
Posted - 2004-06-11 : 08:53:46
|
| Tim how would you do the conversion?I been trying with convert function but so far no luck. I keep gettingError converting data type varchar to numeric.Keithc MCSE MCSA |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-06-11 : 08:56:26
|
| declare @dob as datetimeset @dob = '1960-10-24 00:04:01.917'select cast(@dob as decimal(18, 4))Duane. |
 |
|
|
keithc1
Yak Posting Veteran
88 Posts |
Posted - 2004-06-11 : 09:15:50
|
Awesome!!!Thanks a bunch ditch Keithc MCSE MCSA |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-06-11 : 09:31:15
|
| This can also be done without using variables:select cast(CAST('1960-10-24 00:04:01.917' as datetime) as decimal(18, 4))Duane. |
 |
|
|
|
|
|