|
View previous topic :: View next topic
|
| Author |
Message |
sree reddy
New User
Joined: 20 Jul 2007 Posts: 27 Location: bangalore
|
|
|
|
Could any one please send me query to get the NUMBER of days between 2 timstamps AND SUBTRACT SOME DAYS FROM THE DIFFERENCE
FOR EXAMPLE
select * From database.table
where date(End_ts)-date(current timestamp) - 50 days.
tHIS QUERY DID NOT WORK
Bye |
|
| Back to top |
|
 |
sree reddy
New User
Joined: 20 Jul 2007 Posts: 27 Location: bangalore
|
|
|
|
select * From database.table
where date(End_ts)<= date(current timestamp) - 50 days. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
| Back to top |
|
 |
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
| sree reddy wrote: |
select * From database.table
where date(End_ts)<= date(current timestamp) - 50 days. |
a little bit better for performance :
Select * from tab1
where End_ts <timestamp(current date,'00.00.00') - 49 days |
|
| Back to top |
|
 |
|
|