All Forums Database
tmcrouse 29 posts Joined 07/14
16 Jul 2014
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.
 

tmcrouse 29 posts Joined 07/14
16 Jul 2014

alter table dl_qpt_cqe.qualmain add timestamp_col timestamp(6) not null default current_timestamp;
The above code worked for me.

dnoeth 4628 posts Joined 11/04
16 Jul 2014

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.

Dieter

You must sign in to leave a comment.