DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 13th, 2005, 01:23 PM
angie_4311 angie_4311 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 3 angie_4311 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 9 sec
Reputation Power: 0
Select rows where current_timestamp-10days

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.

Reply With Quote
  #2  
Old September 14th, 2005, 09:37 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
You are close. Use the DAYS designation to tell it you are talking about ten days.


select * from DB2QP.TRACK_QUERY_INFO where time_created<=(current_timestamp-10 DAYS)


Quote:
Originally Posted by angie_4311
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.
__________________
~Nemi

Before posting did you try:
[ Javadocs | Google ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Select rows where current_timestamp-10days


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway