|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Selecting rows where value is 10 days ago or more
I'm trying to select from a table that has a time_created field. I want to select rows where the time created is 10 days ago or more. I keep getting an error.
select * from DB2QP.TRACK_QUERY_INFO where time_created<=(current_timestamp-10) SQL0182N ERROR The time_created field is of datatype timestamp. Any help would be greatly appreciated. |
|
#2
|
||||
|
||||
|
Is this a mysql question? The error message doesn't seem to indicate that it is. Ask a moderator to move it to the correct forum as there are differences in sql over different databases. what works in one may be slightly different in another.
__________________
MySQL - reformat varchar dates to proper date type || MySQL - room vacancies || output results with column names with mysql only Latest row per group || Deleting duplicates || Gaps in auto increment column My site: sql help articles |
|
#3
|
|||
|
|||
|
ok.
and how do i do that? |
|
#5
|
|||
|
|||
|
|
|
#6
|
||||
|
||||
|
Quote:
They aren't using mysql, so the mysql manual for date time functions won't help. |
|
#7
|
|||
|
|||
|
Take a look at the DB2 Documentation, specifically the Application Programming -> SQL Reference -> Functions and probably the Days function. Sorry, but IBM's use of Javascript and frames prevents me from giving you the exact link.
Edit - and can a mod move this to the DB2 forum? |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Selecting rows where value is 10 days ago or more |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|