
September 20th, 2012, 02:39 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 1
Time spent in forums: 13 m 49 sec
Reputation Power: 0
|
|
|
Sql Query help
Issue:
Trying to bypass programming limitations to solve a customers problem. They are trying to import DOB into our system as mmddyyyy. Our system does not understand this value and its hardcoded to accept mm-dd-yyyy or mm/dd/yyyy. So to bypass I am importing this into the Country field instead of the DOB field
I then run this query
update Patrons set Country = LEFT(country,2)+'/'+substring(country,3,2)+'/'+RIGHT (country,4)
This turns the raw data into the format I need. What I cant seem to figure out myself is the query to say update patrons set country = dob
Heres what I have so far
update Patrons set DateOfBirth = cast(country as daTE) where LEN(Country) =10
Conversion failed when converting date and/or time from character string.
I know I am close but I am missing something. Any ideas?
|