Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Changing Format

  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing Format

    i have a simple query.

    I am extracting data from a database and creating a report. The date in the database is stored in the format YYYY-MM-DD HH:MM:SS but when i display the report i just want the date to be displayed as MM/DD

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    date_format in your mysql query...

    http://dev.mysql.com/doc/refman/5.0/...functions.html

    Something like...

    SELECT `field1`, `field2`, DATE_FORMAT(`dateField`, %c/%d) FROM `table` etc...

    ~Phil~


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •