Solved

DateTime Conversion

Posted on 2013-01-16
3
225 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
Comment Utility
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]
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

743 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

13 Experts available now in Live!

Get 1:1 Help Now