DateTime Conversion

How do I conver a DateTime date field to display only the date.
Example:
SELECT Customer,Invoice,InvoiceDate
From Invoices
Where
Customer = 123

Normal Results:
123    45678    2012-10-222 11:15:03:00

What I need
123    45678    2012-10-222
LVL 2
Phil ChapmanAsked:
Who is Participating?
 
Lee SavidgeCommented:
SELECT Customer,Invoice,convert(nvarchar(10), InvoiceDate, 120) as InvoiceDate
From Invoices
Where
Customer = 123
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please read up this article:
http://www.experts-exchange.com/Database/Miscellaneous/A_1499-DATE-and-TIME-don%27t-be-scared-and-do-it-right-the-first-time.html
above comment is correct, in that regards...
I presume the 222 (day) is a typo
0
 
Phil ChapmanAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.