Conditional SQL Update +100 years

  • Hi,

    I need to update a a load of DOB fields where the date is currently 20## instead of 19## eg. 15/08/24 should read 15/08/1924.

    How do I update using the following type of statement:

    update

    Table Name Here

    set

    dateofbirth = current DOB (-100 years)

    where

    Record = A

    Any help greatly appreciated.

    Ken

  • Hi,

    The following query will do that.

    update

    Table Name Here

    set

    dateofbirth = dateadd(year,-100,dateofbirth)where

    Record = A

    Hope this helps you.

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply