SQL to set Customer Locations

Rather than manually setting the Customer Location field (new in 1.8) I wrote some SQL to do so.  Customers of the housecall business, Creature Comforts, all have account type = Creature Comforts. Hence the requirement was to set the Customer Location to CC for all with ac type = CC, and to EIAH for all the others.

The sql is attached. Don't use it if you are unsure of what it is doing. You will have to alter for your own use. Note also that I did not bypass inactive customers, and perhaps I should have.

Regards, Tim G

Syndicate content