Thanks very much Robert, that worked. I was surprised at the effect of the '*'.


Best regards,

Nicole

Robert Kostko wrote:

Hi, Nicole

IMHO after * all additional field statements "DATE_FORMAT(date_rec,'%Y-%m-%d %T')" are ignored. Try to list all neccessary fields after SELECT and give an alias to DATE_FORMAT(date_rec,'%Y-%m-%d %T') for example:

SELECT [fld_1], [fld_2], ...,[fld_n], DATE_FORMAT(date_rec,'%Y-%m-%d %T') as nice_date FROM arviContacts WHERE fid=$zz";
After that You'll have $row["nice_date"] when You fetch mysql result
Regards,
Robert


----- Original Message ----- From: "Nicole Lallande" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 30, 2002 11:38 PM
Subject: attempting to use DATE_FORMAT function in a SELECT STATEMENT



I am trying to format a TIMESTAMP column on output by using the DATE_FORMAT() function:

Can someone tell me why this does not change the format - no error message - just does not do anything?

$sql = "SELECT * from arviContacts WHERE fid=$zz AND DATE_FORMAT(date_rec,'%Y-%m-%d %T');"

I have also tried

$sql = "SELECT *,DATE_FORMAT(date_rec,'%Y-%m-%d %T') from arviContacts WHERE fid=$zz"; and various other permutations which actually result in error messagets.

I think I am missing a basic concept here....

TIA,

Nicole

Resources accessed: mysql manual, MySQL Cookbook, MySQL Reference Manual


--
########################
Nicole Lallande
[EMAIL PROTECTED]
760.753.6766
########################



---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




--
########################
Nicole Lallande
[EMAIL PROTECTED]
760.753.6766
########################




---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/doc/         (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to