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 |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-01-15 : 09:16:27
|
i have 2 fiels like :a varchar 8b varchar 8 a b22/12/08 28/12/08 how can i know the number of hours between a and b?thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-15 : 09:29:03
|
quote: Originally posted by inbs i have 2 fiels like :a varchar 8b varchar 8 a b22/12/08 28/12/08 how can i know the number of hours between a and b?thanks
why are you storing dates in varchar field? |
 |
|
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-01-15 : 09:38:03
|
| cause i get them from source as varcharand how i can do it for time? |
 |
|
|
Skorch
Constraint Violating Yak Guru
300 Posts |
Posted - 2009-01-15 : 10:49:38
|
quote: Originally posted by inbs cause i get them from source as varcharand how i can do it for time?
Just because your source is varchar doesn't mean your column should be of the same type. As long as your data is a valid date, you can pass it to a datetime column. |
 |
|
|
|
|
|