Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

DateTime Conversion

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

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

What I need
123    45678    2012-10-222
Phil Chapman
Phil Chapman
1 Solution
Lee SavidgeCommented:
SELECT Customer,Invoice,convert(nvarchar(10), InvoiceDate, 120) as InvoiceDate
From Invoices
Customer = 123
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please read up this article:
above comment is correct, in that regards...
I presume the 222 (day) is a typo
Phil ChapmanAuthor Commented:
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.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now