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

SQL server 2000 datetime type?

Status
Not open for further replies.

markshen2004

Programmer
Jun 9, 2004
89
0
0
CA
what is the format for datetime type in SQL Server 2000?

mm/dd/yy or dd/mm/yy

May I control the format? Thanks

Mark
 
hi mark
the standard format is yyyy-mm-dd
you can change it using the covert function
convert(<data type>(length),<date>,style)
style 101 is dd/mm/yyyy
 
please give me a examole for.

convert(<data type>(length),<date>,style)

Thanks
 
markshen2004,

Do you have SQL Server Books Online installed with Enterprise Manager? All the help you need should be in there.

Also, if you want your whole database to operate with a different format, you might look into the SET DATEFORMAT option.

SET DATEFORMAT mdy
SET DATEFORMAT dmy
 
I do not have SQL Server Books Online .Please let me know if I can view it online but I need the URL.thank
 
Mark,

BOL is installed as part of the Client Tools. You can find it at Start>Programs>Microsoft SQL Server>Books OnLine.

-SQLBill
 
YOu can also click on help in ENterprise Manager

Questions about posting. See faq183-874
 
Actually, help in enterprise manager only points to the microsoft management console help file.
Query Analyzer has an excellent transact SQL reference. Lookup Cast and Convert and they have a whole section on date format manipulation.
 
When I hit F1 in Enterprise Manager, SQL Server Books Online comes up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top