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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Field Format

Status
Not open for further replies.

strom99

MIS
Nov 28, 2000
126
US
I have the following field I am displaying in an HTML page

2003-04-15 14:48:18.25

How can I change my SQL to only show the
2003-04-15
or
04-15-2003
or
April 15 2003

Thanks
SQL Server 2000
 

select convert(varchar(10),'2003-04-15 14:48:18.25',101)
 
For better performance, you should handle data formatting from the front-end app rather than while retrieving the data from the DB, eg using ASP:

Code:
Response.Write FormatDateTime(rs("date_field"), 2)

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top