Change Field type from Date to Date/Time

madanm7786
Mega Guru

Hi All,

We have custom table which is extended from Task table. I have around 10 fields of type date and i need to change that date field to date/time.

I tried in Configure Dictionary and also in list view in sys_dictionary table and i was not able to change.

We have used these field names in lot of scripts.

Is there any way to do so.

Thanks,

Maddy

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Madan,

It is not best practice to interchange date to date/time and date/time to date because it may lead to issue in the database for the values.

Recommended approach:

1) create new field and copy the data from existing column to newly created column

2) update any script which uses this existing column to use newly created column

3) if not required deactivate that existing field or delete the column

For copying the data from existing to new column have fix script

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

hi Ankur,

 

in change request table cab date is date field and planned start date is date/ time field. How to subtract cabdate-planned start date