Solved

DateTime Conversion

Posted on 2013-01-16
3
226 Views
Last Modified: 2013-01-16
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
0
Comment
Question by:PhilChapmanJr
3 Comments
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 38782430
SELECT Customer,Invoice,convert(nvarchar(10), InvoiceDate, 120) as InvoiceDate
From Invoices
Where
Customer = 123
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38782445
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
 
LVL 2

Author Closing Comment

by:PhilChapmanJr
ID: 38782487
Thanks
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now