By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

php and mssql 's date type

P: n/a
hi,

I fetch a row from an MSSQL db with a field that's of type date. I'm returned
i.e. Oct 15 2003 12:00AM.
code:
$test = mssql_fetch_row($resultmail);
echo $test[0];

I want only to get the date returned and not the time i.e. Oct 15 2003.
Any clever way of doing that?

obscurr
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

On 23-Oct-2003, ob*****@hotmail.com (Obscurr) wrote:
I fetch a row from an MSSQL db with a field that's of type date. I'm
returned
i.e. Oct 15 2003 12:00AM.
code:
$test = mssql_fetch_row($resultmail);
echo $test[0];

I want only to get the date returned and not the time i.e. Oct 15 2003.
Any clever way of doing that?


select date_format(datecolumnname,'%b %d %Y') from ...

see
http://www.mysql.com/doc/en/Date_and...functions.html

--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

P: n/a
Hi !

On 23 Oct 2003 06:01:04 -0700, ob*****@hotmail.com (Obscurr) wrote:
hi,

I fetch a row from an MSSQL db with a field that's of type date. I'm returned
i.e. Oct 15 2003 12:00AM.
code:
$test = mssql_fetch_row($resultmail);
echo $test[0];

I want only to get the date returned and not the time i.e. Oct 15 2003.
Any clever way of doing that?


select convert (datetime, column, 106) from table

or look at convert in the MSSQL help file.

HTH, Jochen
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.