Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(T-Sql)-Convert DateTime to Date 1

Status
Not open for further replies.

markajem

Programmer
Dec 20, 2001
564
US


Sorry, syntax again.

Trying to convert a DateTime to display as a Date in a VIEW I am creating.

Data is:
[tt]
2006-07-15 00:00:00.000
[/tt]

Would like it to be:
[tt]
2006-07-15
[/tt]

Also would anyone know of a good link/s where I can go and find some of the syntax listing I need. I am green at this and usually refer back to old VIEW's I have written for hints as to what I am doing wrong.

Thanks
 
Glad to help you unknown2006.

-SQLBill

Posting advice: FAQ481-4875
 
instead of

select left(convert(varchar,getdate(),120),10)

you could just say

select convert(varchar(10),getdate(),120)

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top