Subject | Re: Subtract Years from a Date Value in SQL |
---|---|
Author | Ian A. Newby |
Post date | 2005-03-01T16:13:55Z |
Hi,
you could try
select cast (extract(day from datefield) || '.' || extract(month from
datefield) || '.' || (extract(year from datefield)-100) as date) from
mytable
or update mytable set datefield = cast (extract(day from datefield) ||
'.' || extract(month from datefield) || '.' || (extract(year from
datefield)-100) as date)
I'm not sure what would happen to leap years though.
Regards
Ian Newby
you could try
select cast (extract(day from datefield) || '.' || extract(month from
datefield) || '.' || (extract(year from datefield)-100) as date) from
mytable
or update mytable set datefield = cast (extract(day from datefield) ||
'.' || extract(month from datefield) || '.' || (extract(year from
datefield)-100) as date)
I'm not sure what would happen to leap years though.
Regards
Ian Newby