sql server - php to call MSSQL query and compare two dates? -



sql server - php to call MSSQL query and compare two dates? -

ahoy there all, bit stuck , need help.

i calling external mssql (not mysql) database linux server , display results after today's date. here code:

$today = date("y-m-d");// current date $date = strtotime(date("y-m-d", strtotime($today))); $todaysdate = date( 'm j y g:i:s:000a', $date ); //converts mssql standards $query = "select dateofarrival atable dateofarrival > '". $todaysdate ."'";

when run query, displays results, doesn't give flying hoot where.

i guessing because comparing date string? not sure on 1 though.

any thoughts? give thanks in advance!

update: here echoed query string.

$query = "select dateofarrival atable dateofarrival > 'jan 10 2012 12:00:00:000am'";

date examples stored in db:

feb 28 2004 12:00:00:000am oct 14 2009 12:00:00:000am may 18 2011 12:00:00:000am apr 10 2012 12:00:00:000am

t-sql/mssql uses standard armed forces format, see "m j y g:i:s:000a" format because using software converts output fit locale of scheme or locale of database, i'm not sure one.

what know sure when comparing dates in mssql, in other system, always utilize the

y-m-d g:i:s

format. how databases store info , how expects provided when input or compare.

i've done 5 years of work in vb6 + mssql, confirm sure... nil fancy in vb6, had larn format myself.

php sql-server date

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -