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 |
rammohan
Posting Yak Master
212 Posts |
Posted - 2011-08-22 : 07:55:46
|
Hi All,I am working with getdate() function....I really wanted to know how the following statement work, though it is giving resultselect select getdate()- 0.3Please help me to understand itOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-22 : 09:26:51
|
getdate() returns system date. date is internal stored as a integer value and 0 value corresponds to base date of 1 Jan 1900. so getdate-0.3 will give you 0.3 of day subtracted from current date time. ie 0.3 * 24 hrs = 7.2 hrs = 432 mins. see belowselect getdate()-0.3,dateadd(mi,-432,getdate())they should give you same value------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2011-08-22 : 09:29:55
|
Thanks VisakhOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-22 : 09:35:33
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|