Author |
Topic |
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-09-28 : 05:43:00
|
Hi All, i m getting the following resultset from one of my query.i wants timnings to be display with the rage of 12 hours.2007-09-24 09:45:00.0002007-09-24 12:32:00.0002007-09-24 13:03:00.0002007-09-24 17:35:00.000required2007-09-24 09:45:00.0002007-09-24 12:32:00.0002007-09-24 01:03:00.0002007-09-24 05:35:00.000thanks in advance, |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-28 : 05:56:25
|
Rage for 12 hours? Please go see a psychiatrist...  SELECT CASE WHEN HOUR(Col1) >= 12 THEN DATEADD(HOUR, -12, Col1) ELSE Col1 END AS NewTime, Col1 AS OldTimeFROM Table1 E 12°55'05.25"N 56°04'39.16" |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-09-28 : 05:58:44
|
And with 12-hr format you will need, AM/PM as well...other wise how will you separate day from night? Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-28 : 06:01:40
|
He will probably look out through the window. E 12°55'05.25"N 56°04'39.16" |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-09-28 : 06:08:17
|
quote: Originally posted by Peso He will probably look out through the window. E 12°55'05.25"N 56°04'39.16"
  Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-28 : 06:15:17
|
Oh man...I we were to questioning every poster WHY he or she wants to do things the way they want, we would never do anything else!Sometimes I think it is appropriate to ask why when it is obvious that OP is barking at the wrong tree. E 12°55'05.25"N 56°04'39.16" |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-09-28 : 06:21:49
|
As per me, asking WHY is important, sometimes it clears OP's mind regarding what he really want to do. Also, it will be waste of time if we pour in hundreads of solutions while OP wanted something else or he was not sure what he wanted.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-28 : 06:33:02
|
I think he will get what he asks for.In most cases the OP writes "urgent", which means it is a homework assignment.Also that is a lesson for real life. If you don't know what your are working with, you can't ask how to fix it.And if you know what you are working with, you know what to ask for.But I have been proven otherwise several times here at SQLTeam  E 12°55'05.25"N 56°04'39.16" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-28 : 06:37:28
|
quote: Originally posted by mahesh_bote Hi All, i m getting the following resultset from one of my query.i wants timnings to be display with the rage of 12 hours.2007-09-24 09:45:00.0002007-09-24 12:32:00.0002007-09-24 13:03:00.0002007-09-24 17:35:00.000required2007-09-24 09:45:00.0002007-09-24 12:32:00.0002007-09-24 01:03:00.0002007-09-24 05:35:00.000thanks in advance,
Why do you want to do this?MadhivananFailing to plan is Planning to fail |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-29 : 04:47:27
|
quote: Originally posted by Peso He will probably look out through the window. E 12°55'05.25"N 56°04'39.16"
Don't have to. Just look at the bottom right corner. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|