If DateReceived column in int, then:
update tblOrder
set DateReceived = '13' + cast(DateReceived as varchar(max)) -- or: concat('13', DateReceived)
where DateReceived <> 0
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have some tables in SQL and I want to add two digit (the two digit is a fixed number that is 13 ) to the first of all numbers in a some columns. I used this script but unfortunately it doesn't work accurately:
for example I want to change 991105 to 13991105.
my script is as follow:
use SKraseh;
UPDATE tblOrder SET tblOrder.DateReceived = 13 & [DateReceived]
WHERE (((tblOrder.DateReceived)<>0));
If DateReceived column in int, then:
update tblOrder
set DateReceived = '13' + cast(DateReceived as varchar(max)) -- or: concat('13', DateReceived)
where DateReceived <> 0
Hi @Amir-1643,
Welcome to Microsoft Q&A.
Glad to hear that the issue has been resolved.
If you have any other question, don't hesitate to post in the forum.
Wish you a nice day!
Regards,
Zoe