jenlion
IS-IT--Management
- Nov 13, 2001
- 215
Hi all,
I have a table with a field for "postal code" and a field for "country".
I have another table that stores the "country" and the "postal code mask", which is the country's appropriate format.
For example, in the format table, I have:
Country PostalCodeMask
----------------------------
USA 99999-9999
CAN N9N 9N9
My table holding the data looks like this:
Country PostalCode
----------------------------
USA 164715324
CAN L9B3C4
(these are made up postal codes, but the real data in the table has already been verified and is correct).
I don't need to verify numbers/letters; I just need to insert dashes or spaces in the correct spots depending on the format.
I need to do this in an efficient way, too. Processing thousands of these at a time for reports generated several times a day. I'm looking to use something like 'update datatable set postalcode = (postal code using mask from other table)'
I can update this field without consequences because this is a temporary holding table used for printing a crystal report only.
I need the results to be:
Country PostalCode
----------------------------
USA 16471-5324
CAN L9B 3C4
Can anyone help with a good function for this? Pretty urgent for me.
Thanks!
I have a table with a field for "postal code" and a field for "country".
I have another table that stores the "country" and the "postal code mask", which is the country's appropriate format.
For example, in the format table, I have:
Country PostalCodeMask
----------------------------
USA 99999-9999
CAN N9N 9N9
My table holding the data looks like this:
Country PostalCode
----------------------------
USA 164715324
CAN L9B3C4
(these are made up postal codes, but the real data in the table has already been verified and is correct).
I don't need to verify numbers/letters; I just need to insert dashes or spaces in the correct spots depending on the format.
I need to do this in an efficient way, too. Processing thousands of these at a time for reports generated several times a day. I'm looking to use something like 'update datatable set postalcode = (postal code using mask from other table)'
I can update this field without consequences because this is a temporary holding table used for printing a crystal report only.
I need the results to be:
Country PostalCode
----------------------------
USA 16471-5324
CAN L9B 3C4
Can anyone help with a good function for this? Pretty urgent for me.
Thanks!