If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > SELECT Statement - Next 7 days

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Posts: 1
Question SELECT Statement - Next 7 days

Hello,

I am currently using the informix odbc driver to pass a simple query the database - using 'CURRENT' to specify the rows I want. Typically for other databases I use getdate() or now() or curdate(), all of which allow you to add days, IE:

SELECT Date from Table1 where Date > now() and Date < now() + 7

So I'm looking for the informix equivalent of this invalid statement.

SELECT Date from Table1 where Date > CURRENT and Date < CURRENT + 7

Thank you for your help.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 144
CURRENT is used with the DATETIME data type to indicate precision (year, month, day, hour, minute, second, fraction) to be used with DATETIME data manipulation so try using "today" which gives you today's date:

SELECT Date from Table1 where Date > today and Date < today + 7

Last edited by mjldba; 12-10-12 at 09:17.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 2
Where DATE > TODAY AND DATE < (TODAY + 7 UNITS DAY)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On