Question

Database package issue

  • 27 May 2023
  • 1 reply
  • 24 views

Badge +1

UPDATE [Sheet1$$]
SET Customer = IIF(Customer LIKE '000%', SUBSTRING(Customer, 4), Customer)
WHERE Customer LIKE '000%';
Why this query is not working?

Customer
0001645445
0001026470
1645338
1645338
0001022163
1645426
1645338
1645370

1 reply

Userlevel 3
Badge +6

Try this:

UPDATE [Sheet1$$]
SET Customer = RIGHT(Customer, LEN(Customer) - 3)
WHERE LEFT(Customer, 3) = '000';

Reply