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 > How to search by Date in SQL?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-10, 16:21
mlong30 mlong30 is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
How to search by Date in Informix SQL?

How do I search by a specific date in Informix? I tried the following, but I'm missing something.

Fieldname: resultdate is (datetime)

SELECT *
FROM vtest
WHERE resultdate = DATE('2010-10-08')

SELECT *
FROM vtest
WHERE To_CHAR(resultdate,'YYYY-MM-DD') = '2010-10-08'

Thanks.
Matt

Last edited by mlong30; 11-16-10 at 13:06.
Reply With Quote
  #2 (permalink)  
Old 11-17-10, 07:04
Luis Santos Luis Santos is offline
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 51
Hi mlong30,

You only have to write:

SELECT * FROM vtest WHERE resultdate = "2010-10-08";

Have fun!
__________________
LS
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