rockman
Senior Member
- Local time
- Yesterday, 16:11
- Joined
- May 29, 2002
- Messages
- 190
I have a database of contacts (tblContacts). One of the fields is fldZipCode.
I have a database of zip codes that contain fields fldZipCode (pk), fldCity, and fldState.
I'd like to create an updateable query (to be used by a form) that joins the Contact information and City/State. The following query is updateable:
My problem is the Contacts' fldZipCode may contain a 5 character string or the new 9 character string (Zip+4). The following query is NOT updateable:
Can anyone think of a possible SQL syntax that would accomplish this task and still leave the recordset updateable?
Thanks for any thoughts,
Jeff
I have a database of zip codes that contain fields fldZipCode (pk), fldCity, and fldState.
I'd like to create an updateable query (to be used by a form) that joins the Contact information and City/State. The following query is updateable:
Code:
SELECT tblContacts.*, tblZipCodes.fldCity, tblZipCodes.fldState
FROM tblContacts LEFT JOIN tblZipCodes on tblContacts.fldZipCode=tblZipCodes.fldZipCode
My problem is the Contacts' fldZipCode may contain a 5 character string or the new 9 character string (Zip+4). The following query is NOT updateable:
Code:
SELECT tblContacts.*, tblZipCodes.fldCity, tblZipCodes.fldState
FROM tblContacts LEFT JOIN tblZipCodes on [B][U]Left(tblContacts.fldZipCode,5)[/U][/B]=tblZipCodes.fldZipCode
Can anyone think of a possible SQL syntax that would accomplish this task and still leave the recordset updateable?
Thanks for any thoughts,
Jeff