Converting TIMESTAMP Columns to DATE or TIME
From InterBase
Go Up to DATE, TIME, and TIMESTAMP Data Types
Once you have migrated a database to dialect 3, any columns that previously had the DATE data type will have the TIMESTAMP data type. If you want to store that data in a DATE or TIME column, follow these steps:
- Use
ALTER TABLEto create a new column of the desired type. - Insert the values from the original column into the new column:
UPDATE tablename SET new_field = CAST (old_field AS new_field);
- Use
ALTER TABLEto drop the original column. - Use
ALTER TABLE…ALTER COLUMNto rename the new column.