Hi,
In Access 2010 DB, I have a main demographic table that contains a person's zip code. In this table the zip code is stored as text since the spreadsheet used to update the data has its zip code column formatted as text because creators of the source spreadsheet can also store the + 4 portion of the zip code which contains the "-" between the first five digits and the last four. Also, several state's zip codes begin with a zero (0). To preserve this, the data needs to be stored as text.
A differnt spreadsheet source does not contain the zip code so I need to search a zip code table based on the person's city/state. In the zip code table the zip codes are defined as text, but are only 5 digits; they do not include the + four values. But when I search for the zip code in this table and store it in a newly created, interim table (which will then be used to batch update the main demographic table), the zip code is stored as a decimal number with two zeros after the decimal point.
I've tried using CStr to convert the value (which already is a string) before adding it to the interim table. This didn't work and the value was still stored as a decimal number.
Short of redefining all the zip codes in the zip code table as 6 digits with a '-' in the sixth position and then storing the Left(zip,5) into the main demographic table, is there another way of handling this situation?
Thanks,
Vic
In Access 2010 DB, I have a main demographic table that contains a person's zip code. In this table the zip code is stored as text since the spreadsheet used to update the data has its zip code column formatted as text because creators of the source spreadsheet can also store the + 4 portion of the zip code which contains the "-" between the first five digits and the last four. Also, several state's zip codes begin with a zero (0). To preserve this, the data needs to be stored as text.
A differnt spreadsheet source does not contain the zip code so I need to search a zip code table based on the person's city/state. In the zip code table the zip codes are defined as text, but are only 5 digits; they do not include the + four values. But when I search for the zip code in this table and store it in a newly created, interim table (which will then be used to batch update the main demographic table), the zip code is stored as a decimal number with two zeros after the decimal point.
I've tried using CStr to convert the value (which already is a string) before adding it to the interim table. This didn't work and the value was still stored as a decimal number.
Short of redefining all the zip codes in the zip code table as 6 digits with a '-' in the sixth position and then storing the Left(zip,5) into the main demographic table, is there another way of handling this situation?
Thanks,
Vic