I have two tables:
membersac :
View attachment 112136
ACtoZIP:
View attachment 112137
Trying to get dataset of membersac.area_code, membersac.AC_Count and ANY 1 zip from ACto Zip. I found the following code but I keep getting "Syntax error in query expression." Any ideas?
SELECT membersac.Area_Code, membersac.AC_Count, ACtoZIP.zip
FROM membersac
LEFT JOIN ACtoZIP
ON ACtoZIP.area_code = membersac.Area_Code
AND ACtoZIP.ID = (SELECT TOP 1 ID
FROM ACtoZIP
WHERE ACtoZIP.area_code = membersac.Area_Code);
membersac :
View attachment 112136
ACtoZIP:
View attachment 112137
Trying to get dataset of membersac.area_code, membersac.AC_Count and ANY 1 zip from ACto Zip. I found the following code but I keep getting "Syntax error in query expression." Any ideas?
SELECT membersac.Area_Code, membersac.AC_Count, ACtoZIP.zip
FROM membersac
LEFT JOIN ACtoZIP
ON ACtoZIP.area_code = membersac.Area_Code
AND ACtoZIP.ID = (SELECT TOP 1 ID
FROM ACtoZIP
WHERE ACtoZIP.area_code = membersac.Area_Code);