July 19, 2010 at 7:49 am
I am using the CONVERT function to format a date with the century. My code is like this:
CONVERT(VARCHAR(8), mydate, 112)
where mydate is a datetime datafield in a table.
The problem I am having is that I cannot seem to control the century threshold that is returned. For example, if my input date has a value of 3/1/29, it is returning a value of 20290301 and not 19290301 as I would expect. If I convert a date like 12/25/50, it converts it properly to 19501225.
I have looked to see if there was some kind of setting that would control the threshold of when the century is set to last one or uses the current. I know many software have the ability to control that threshold. Is there one in SQL 2005?
July 19, 2010 at 8:00 am
Check this one:
July 19, 2010 at 2:30 pm
Thanks... It's just what I needed.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply