Greetings and salutations.

I have this data entry problem, that I have placed a fix for the users, but 
I have entries in the DB that have the wrong date format.  There are dates 
entered in this format, 2010-1-1 instead of 2010-01-01.  Say that I had this 
table,

table1.
id,st,ca,d1,d2
1,AA,BB,2010-1-1,2010-2-9
1,BB,BB,2010-1-1,2010-3-29
1,CC,BB,2010-10-4,2010-5-13
1,DD,BB,2010-1-10,2010-02-01

What I would like to do is a call that can fix the dates to the correct 
format, ie. YYYY-MM-DD, so that the final data looks like this,

table1.
id,st,ca,d1,d2
1,AA,BB,2010-01-01,2010-02-09
1,BB,BB,2010-01-01,2010-03-29
1,CC,BB,2010-10-04,2010-05-13
1,DD,BB,2010-01-10,2010-02-01

I know I can do a bunch of sets, such as this one,

UPDATE table1 set d1 = '2010-01-01'
    where
        d1 = '2010-1-1';

but that is a lot of coding.  I thought that perhaps there would be an 
easier regular expression call within the DB engine.

Any help would be greatly appreciated.

thanks,

josé 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to