Computing.Net > Forums > Database > date format in SQL Server

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

date format in SQL Server

Reply to Message Icon

Name: bismarkcount
Date: July 12, 2007 at 07:36:50 Pacific
OS: windows xp
CPU/Ram: 1gb
Product: dell
Comment:

Hi!
i would like some help to figure this out:

How can i select a datetime field in sql server in an specific format?

ie: when i execute:
select (datefield) from table
the result is something like:
07/12/2007 09:34

is there a way to do something like this oracle sentence for SQL Server?:
select to_char(datefield, 'mm/dd/yyyy') from table

thnx a lot



Sponsored Link
Ads by Google

Response Number 1
Name: jqp
Date: July 19, 2007 at 18:16:47 Pacific
Reply:

Yes, you need to look up CAST and CONVERT in the SQL Server Books Online - it will probably have an example that you want.

ASUS M2NPV-VM <> Athlon X2 4200+ <> 2GB 800Mhz <> 1TBinternal storage 1TB DAS usb <> nVidia Geforce 6150 <> Samsung 22"


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: date format in SQL Server

SQL Server Reporting Services www.computing.net/answers/dbase/sql-server-reporting-services/722.html

SQL Server Errors www.computing.net/answers/dbase/sql-server-errors/421.html

SQL Server 7.0 www.computing.net/answers/dbase/sql-server-70/618.html