Hello RickP,
I suggest first you run following small script in query analyzer and see the result. Then look up help On function CONVERT. Also read topic 'Truncating the time from a datetime field' on page 372 of the book and you will not have any problem with datetime field in sql Server 2000 again.
Hope this helps.
tbj
declare @todaysDate DateTime
declare @ConvertedDate datetime
declare @aDate datetime
set @aDate = '12/05/2005'
set @todaysdate = getdate()
set @converteddate = convert( datetime, convert(varchar(12), @todaysdate, 111))
print 'getdate = ' + cast(getdate() as varchar)
print ' todays date = ' + convert(varchar(12), @todaysdate, 111)
print 'Converted date = ' + convert(varchar(12), @converteddate, 111)
print 'aDate = ' + convert(varchar(12), @aDate, 111)
print ' (varchar-10) todays date = ' + convert(varchar(10), @todaysdate, 111)
print ' (varchar-10) Converted date = ' + convert(varchar(10), @converteddate, 111)
go
|