| Author |
Topic |
|
SCHEMA
Posting Yak Master
192 Posts |
Posted - 2008-07-22 : 13:13:24
|
| How i can go backup in this date from current one:2005-05-08 from getdate()? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-22 : 13:16:21
|
| DATEADD(dd,(-1) * DATEDIFF(dd,'2005-05-08',getdate()),getdate()) |
 |
|
|
SCHEMA
Posting Yak Master
192 Posts |
Posted - 2008-07-22 : 13:19:16
|
| Thanks.I want to go 2005-05-08 00:00:01 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-22 : 13:21:54
|
quote: Originally posted by SCHEMA Thanks.I want to go 2005-05-08 00:00:01
just add a sec to query aboveselect dateadd(ss,1,DATEADD(dd,(-1) * DATEDIFF(dd,'2005-05-08',getdate()),getdate()))didnt get your scenario though. can you explain? |
 |
|
|
SCHEMA
Posting Yak Master
192 Posts |
Posted - 2008-07-22 : 13:23:49
|
| Didn't get result?I want to go back to 2005-05-08 00:00:01 (starting from that date) |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-22 : 13:27:57
|
| You are very unclear in your request, do you just wantSELECT *FROM yourTableWHERE aDateColumn BETWEEN '05/08/2005' and getdate()?Jim |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-22 : 13:32:59
|
| please post some sample data and show what you want out of them. |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-07-22 : 13:49:00
|
Yeah, what do you mean by "I want to go back to..."?I would like to go back as well, there are several "if I only knew then what I know now" potential conquests that I would like another crack at Be One with the OptimizerTG |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2008-07-22 : 14:05:47
|
| I think he needs all the dates starting from 2005-05-08 to today |
 |
|
|
|