SQL BOL has this to say about SET DATEFORMAT.
[ul]
"This setting is used only in the interpretation of character strings as they are converted to date values. It has no effect on the display of date values."(empahsis added)[/ul]I wrote the following SQL script to demonstrate the use of SET DATEFORMAT and how to display dates in various formats. Hopefully, running this script in Query Analyzer will help clarify the date concepts.
-----------------------------------------------------
-- Create temp table for test
create table #tmp (DateCol datetime)
set nocount on
go
-- Insert a date dmy format
set dateformat dmy
insert #tmp values('30/6/02')
go
-- Insert a date mdy format
set dateformat mdy
insert #tmp values('3/6/02')
go
-- Insert a date ymd format
set dateformat ymd
insert #tmp values('3/6/02')
go
-- Insert a date ydm format
set dateformat ydm
insert #tmp values('3/6/02')
go
--Display dates in default SQL format
Select Datecol As StyleDflt
From #tmp
Go
--Display dates in dd/mm/yy format
Select Style3=Convert(char(8), datecol, 3)
From #tmp
Go
--Display dates in dd/mm/yyyy format
Select Style103=Convert(char(10), datecol, 103)
From #tmp
Go
--Display dates in mmm dd yyyy format
Select Style100=Convert(char(12), datecol, 100)
From #tmp
Go
--Display dates in yyyy/mm/dd format
Select Style111=Convert(char(10), datecol, 111)
From #tmp
Go
--cleanup
Drop table #tmp
go Terry L. Broadbent - Salt Lake City, UT
Home of the 2002 Winter Olympics (Feb 8-24)