At 9:13 AM +0000 2/2/01, Ben Cairns wrote:
>I have a date stored in a MySQL field in a format like this:
>
>For example, 02/02/2001 (Today) would be stored as:
>02022001
>
>What I need to do is to format that so that it looks like:
>02/02/2001

I assume you really have this stored as a CHAR column, because you
can't store a date as 02022001.  On that assumption, you can format
the string like this:

SELECT
         CONCAT(
                         LEFT(d,2),
                         "/",
                         MID(d,3,2),
                         "/",
                         RIGHT(d,4))
FROM t;


>
>-- Ben Cairns - Head Of Technical Operations
>intasept.COM
>Tel: 01332 365333
>Fax: 01332 346010
>E-Mail: [EMAIL PROTECTED]
>Web: http://www.intasept.com
>
>"MAKING sense of
>the INFORMATION
>TECHNOLOGY age
>@ WORK......"


-- 
Paul DuBois, [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to