> update tableName set DOB=substr(DOB,7,4)||substr(DOB,3,4)||substr(DOB,1,2);
Am I missing some magic here? To me, this looks like it'll result in YYYYMMDD. Does SQLite convert YYYYMMDD date strings? I would've gone with the original YYYY-MM-DD date string that Igor posted. Thanks! -Clark ----- Original Message ---- From: Gerry Snyder <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, August 18, 2006 5:54:22 AM Subject: Re: [sqlite] Re: Using Wrong Date Format Igor Tandetnik wrote: > Eoin Collins <[EMAIL PROTECTED]> > wrote: >> The database I'm currently using has a field Date Of Birth, and all >> enteries in are in dd-mm-yyyy format. >> >> I need them in yyyy-mm-dd format. > > update tableName set > DOB=substr(DOB,7,4)||'-'||substr(DOB,4,2)||'-'||substr(DOB,1,2); > One tiny simplification: |'-'||substr(DOB,4,2)||'-'| can be replaced by |substr(DOB,3,4)| making the total command: update tableName set DOB=substr(DOB,7,4)||substr(DOB,3,4)||substr(DOB,1,2); Gerry ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

