I have a table where the date of new_value get reflected on old_value columns.
These values are configured on query_entity while writing to table but missing the desired value for few columns.
But for few columns, the date was not displayed, so i need to update the data in Prod with a sql query.
This is how the date is displayed from Action_on
While below is the snap where i need to update, along with the text value i want to update it to text(date)
I also want to update it with date only while Action_on is in dateTime format.
Please help me on this.
Discussion posts and replies are publicly visible
Also, FIELD_NAME = 'Status'
Thank you so much,
the query you provided worked but the date i want to reflect is on dateTime while i want only date to be refleted without time.
Can that be achieved?
Yes. Try CAST(myDateTime AS DATE), so:UPDATE <YOUR_TABLE_NAME> SET OLD_VALUE = CONCAT(OLD_VALUE,CAST(myDateTime AS DATE)) WHERE OLD_VALUE NOT LIKE '%/%' AND FIELD_NAME='Status';If you need to format the date afterwards, then something like Date_Format(CAST(MYDATETIME AS DATE),'%m/%d/%y') could work. Simple example below:
Yes. Try CAST(myDateTime AS DATE), so:UPDATE <YOUR_TABLE_NAME> SET OLD_VALUE = CONCAT(OLD_VALUE,
) WHERE OLD_VALUE NOT LIKE '%/%' AND FIELD_NAME='Status';If you need to format the date afterwards, then something like Date_Format(CAST(MYDATETIME AS DATE),'%m/%d/%y') could work. Simple example below:
Will try it out.
Thank you so much for your response