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 > PC based Database Applications > Other PC Databases > DBase and dates

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-23-08, 08:15
Zikiti Zikiti is offline
Registered User
 
Join Date: Oct 2008
Posts: 2
DBase and dates

I am trying to compare a date stored in an ODBC accessed date field with no luck. When I read the date field it returns a date formatted like 'yyyy-mm-dd' but when I try to programatically compare a date read with my own date I can't get a match, even if i copy that same date directly from what was read.

sample code:
$sql = "SELECT * FROM DB.DBF WHERE DATEFIELD = '2008-01-01' ";

That query returns no results although I am certain that at least 1 record exists which matches the criteria.

Using PHP am I missing something?
Reply With Quote
  #2 (permalink)  
Old 05-29-09, 06:56
AnanthaP AnanthaP is offline
Registered User
 
Join Date: May 2009
Location: India
Posts: 62
Try "SELECT * FROM DB.DBF WHERE DATEFIELD = ctod('01/01/2008')"

End
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