I am trying to update a SQL table. Basically, I want to take our customers and move some of their invoices to a different batches. The problem seems to be one account that has a non-numeric account number called CASH. All the other accounts are numeric. Here what I tried to run:
I get the following error:
Any suggestions?
Thanks,
Pat
Code:
update rm20101
set bachnumb = CASE
when custnmbr > 9999 and custnmbr < 11000
then 'BULK-1'
when custnmbr > 10999 and custnmbr < 12000
then 'BULK-2'
when custnmbr > 11999 and custnmbr < 13000
then 'BULK-3'
when custnmbr > 12999 and custnmbr < 14000
then 'BULK-4'
when custnmbr > 13999 and custnmbr < 15000
then 'BULK-5'
when custnmbr > 40999 and custnmbr < 51000
then 'BULK-6'
ELSE 'BULK'
End;
I get the following error:
Code:
Server: Msg 245, Level 16, State 1, Line 2
Syntax error converting the varchar value 'CASH ' to a column of data type int.
Any suggestions?
Thanks,
Pat