I suggest formatting the date with ODBC data escape syntax:

for a timestamp:  '{ts, \'yyyy-mm-dd hh:mm:ss\'}'
or just a date:  '{d \'yyyy-mm-dd\'}'


Best regards,
Andrew
--------------------------------------------
Andrew Hill . Director Technology Evangelism
OpenLink Software . www.openlinksw.com
Internet Data Integration Technology



On 4/11/01 6:00 AM, "Steve Brett" <[EMAIL PROTECTED]> wrote:

> i think you need
> 
> SELECT * FROM news WHERE fdate >= '$date' AND tdate >= '$date'
> 
> the dates have to be single-quoted in your query string
> 
> i generally use
> 
> $query = "SELECT * FROM news WHERE fdate >= '".$date."' AND tdate >=
> '".date."'";
> 
> this may not be the best way and i would really appreciate it if someone
> could give me the 'correct' way. it's the way i used when i first started
> using php and have kinda kept it ....
> 
> Steve
> 
>> -----Original Message-----
>> From: Walter Franssen [mailto:[EMAIL PROTECTED]]
>> Sent: 11 April 2001 10:47
>> To: [EMAIL PROTECTED]
>> Subject: [PHP-DB] OBDC date problems
>> 
>> 
>> 
>> Hello, i have some problems with date's in a query like
>> 
>> SELECT * FROM news WHERE fdate >= $date AND tdate >= #date
>> 
>> Can someone help me
>> 
>> 
>> 
>> -- 
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail:
>> [EMAIL PROTECTED]
>> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to