E
el zorro
I'm thinking this may not be posssible, but...
An alphanumeric ID Number that I have in my ADP/SQL database contains within
it 6 characters representing the birth date. So of you were born today, your
ID would include 010510, as in mmddyy.
I can extract those 6 edigits using SUBSTRING(), but I can't seem to get
them to convert to a date data type (so I can test for the age of the
person). As an experiment, I used a today's date in this expression:
CONVERT (nvarchar, CONVERT (DATETIME, '010510', 1))
and got "May 10 2001 12:00AM" as the output. Obviously, the function did
not read my string as mmddyy, but as yymmdd. What I want is for the output to
be "01/05/10." Is this possible?
Thanks!
(I tried to post an earlier version of this question here, but I don't see.
I apologize if it shows up somewhere.)
THanks!
An alphanumeric ID Number that I have in my ADP/SQL database contains within
it 6 characters representing the birth date. So of you were born today, your
ID would include 010510, as in mmddyy.
I can extract those 6 edigits using SUBSTRING(), but I can't seem to get
them to convert to a date data type (so I can test for the age of the
person). As an experiment, I used a today's date in this expression:
CONVERT (nvarchar, CONVERT (DATETIME, '010510', 1))
and got "May 10 2001 12:00AM" as the output. Obviously, the function did
not read my string as mmddyy, but as yymmdd. What I want is for the output to
be "01/05/10." Is this possible?
Thanks!
(I tried to post an earlier version of this question here, but I don't see.
I apologize if it shows up somewhere.)
THanks!