gamepawn Posted February 1, 2007 Share Posted February 1, 2007 I have been charged with creating an interface around a Synergy Database. I have been given an ODBC driver for the database; it works. In the past, I have only used PHP and MySql, so there is obviously some coding differences, but I managed to figure them out. Except one thing, trying to query the database for dates. I can not figure the syntax out. I used the ODBC driver in MS Access, to build a query with the GUI and then look at the SQL, so I could see the syntax. It basically come back with this: SELECT * FROM Table WHERE (((Table.Date)=#12/28/2006#)); So I used the # symbol in my query inside of PHP...no luck. Is there something I don't know about PHP? Does it ignore the #s? Should I be adding some sort of other character prior to the #s? If anyone has any idea of how to translate the Access query from above into a PHP one that works, well that would be great...because I can't do anything if I can't query a date. Thanks a lot for reading. jacob Link to comment https://forums.phpfreaks.com/topic/36638-solved-php-and-odbc-date-query/ Share on other sites More sharing options...
ted_chou12 Posted February 1, 2007 Share Posted February 1, 2007 what does the hex do? i think you are looking for % <<< usually used to find similar strings in mysql db. Ted Link to comment https://forums.phpfreaks.com/topic/36638-solved-php-and-odbc-date-query/#findComment-174612 Share on other sites More sharing options...
trq Posted February 1, 2007 Share Posted February 1, 2007 If anyone has any idea of how to translate the Access query from above into a PHP one that works Any query your working with needs to be in the valid sql for the database your using. I know access wraps dates in #, maybe synergy doesn't. Nothing to do with php really. Link to comment https://forums.phpfreaks.com/topic/36638-solved-php-and-odbc-date-query/#findComment-174618 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.