Update date format and create timestamp column

Database
Enthusiast

Update date format and create timestamp column

I am trying to update my prog_entdt column so that it is mm-dd-yyyy instead of how it is now of yyyy-mm-dd. I am also trying to create a column to house the timestamp and have tried various alter table and add and cannot seem to find the right format.

2 REPLIES
Enthusiast

Re: Update date format and create timestamp column

alter table dl_qpt_cqe.qualmain add timestamp_col timestamp(6) not null default current_timestamp;

The above code worked for me.

Senior Apprentice

Re: Update date format and create timestamp column

DATE/TIME/TIMESTAMP are always stored in an internal format, what you want is to change the display format, this can be done using adding a FORMAT to the column definition and then a CAST to a VARCHAR in the SELECT.

But usually this is done on the client, Access should be able to format it in a way you want.