Jump to content

[SOLVED] Php and ODBC Date query


gamepawn

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.