Results 1 to 3 of 3
  1. #1
    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.

  2. #2
    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.

  3. #3
    Join Date
    Jan 2013
    Posts
    2
    Where DATE > TODAY AND DATE < (TODAY + 7 UNITS DAY)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •