note 82854 added to function.mssql-query

From: Date: Tue, 29 Apr 2008 15:05:17 +0000
Subject: note 82854 added to function.mssql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-138899@lists.php.net to get a copy of this message
I was tripped up by the fact that mssql_query() returns values for 'datetime' columns in an unusual format. In order to get your values returned in the usual 'YYYY-MM-DD HH:MM:SS' format, you can use the CONVERT function in your query like so: SELECT CONVERT(varchar, INVOICE_DATE, 121) AS INVOICE_DATE ... where 'INVOICE_DATE' is the name of the 'datetime' column. The available datetime conversion formats are listed here: http://msdn2.microsoft.com/en-us/library/aa226054(SQL.80).aspx ---- Server IP: 208.69.120.35 Probable Submitter: 68.75.204.194 ---- Manual Page -- http://www.php.net/manual/en/function.mssql-query.php Edit -- https://master.php.net/note/edit/82854 Del: integrated -- https://master.php.net/note/delete/82854/integrated Del: useless -- https://master.php.net/note/delete/82854/useless Del: bad code -- https://master.php.net/note/delete/82854/bad+code Del: spam -- https://master.php.net/note/delete/82854/spam Del: non-english -- https://master.php.net/note/delete/82854/non-english Del: in docs -- https://master.php.net/note/delete/82854/in+docs Del: other reasons-- https://master.php.net/note/delete/82854 Reject -- https://master.php.net/note/reject/82854 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138899) next »