Re: OBDC date problems

From: Date: Mon, 16 Apr 2001 00:18:32 +0000
Subject: Re: OBDC date problems
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8582@lists.php.net to get a copy of this message
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" <SBrett@e-mis.com> 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:w.franssen@nexwork.nl] >> Sent: 11 April 2001 10:47 >> To: php-db@lists.php.net >> 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: php-db-unsubscribe@lists.php.net >> For additional commands, e-mail: php-db-help@lists.php.net >> To contact the list administrators, e-mail: >> php-list-admin@lists.php.net >>

« previous php.db (#8582) next »