mySQL Extract Query to give date as MMDDYY

I have an PHP script to extract to a CSV. I am trying to get the date to come out as MMDDYY. When I run it now I get the date and time.

Example:   2015-08-28 09:39:27.
I want this to be 082815

This is my query:
   $select_table=$mysqli->query("SELECT tom.OrderNumber,tom.PartNumber,tom.DateOrdered,4 as HardCodedField,tom.QtyOrdered,tom.LineItemApproved FROM `tblorderlineitem` tom ");

Can I use something in my select statement to make date come out this way?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
You can use the MySQL CONCAT() function combined with the Date Functions MONTH(), DAY() and YEAR()
$query = <<< QUERY
    CONCAT(MONTH(tom.DateOrdered), DAY(tom.DateOrdered), YEAR(tom.DateOrdered)) AS DateOrdered, 
    4 AS HardCodedField,
  FROM `tblorderlineitem` tom

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
allenkentAuthor Commented:
Almost but close enough. My date is now 8122015. I need the 0 in front that 20 removed from the 2015. This gets me there. Thank you.
F IgorDeveloperCommented:
If you want fixed format for dates (eg: 082815 instead of 82815 for 2015-08-28) use DATE_FORMAT function:


Open in new window

Format specifiers are defined in : %m (2-digit month) %y (2-digit year) %d (2-digit day)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.