cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Translate the entire conversation x

How to mass update the year for Created On date.

DK_11085982
5-Regular Member

How to mass update the year for Created On date.

Hi team,

How to mass amend/modify the year value for Created On date.

 

For Eg:

01-01-2050 to be modified to 01-01-2015

6 REPLIES 6

Best way to do this would be a SQL update. You didn't say what object they should all be similar. There is no mechanism in Windchill UI to change this but easy enough to do at DB level, and faster too.  Make sure you employ proper backup strategies before update.

DK_11085982
5-Regular Member
(To:avillanueva)

Hi Avillanueva,

 

Thanks for the reply.

Is it possible to touch only the year part of the date?

No, you would need to extract the current date and time, modify it and translate into SQL update scripts to push it back in.  How many records do you have that are wrong?

DK_11085982
5-Regular Member
(To:avillanueva)

Hmm,

Yes, only year is gone wrong. Day and month is correct.

Around 2k records

 

If you are not comfortable running SQL updates against DB, leave it for your DBA but based on what you presented, that is what I would do. You would want to extract the current timestamp column (date and time) and the IDA2A2 field for unique rows, fix the date and make update where the IDA2A2 matches. Take note of timezone shifts since DB might be in GMT, shifting times off by 4-5 hours against EST. Test with one or two row updates before running rest. You should be able to see impact in UI immediately. 

If this is newly imported data as its easy to delete and reimport fixed, I might recommend that too. 

You could probably do this all in sql eg:

update <table name> set <timestamp-field-name> = "<timestamp-field-name> - 35years";

Of the top of my head I can't tell you what the actual syntax for the "<timestamp-field-name> - 35years" part is but shouldn't be too hard to figure out.

Announcements

Top Tags