Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

acess to mysql

Status
Not open for further replies.

ttuser4

MIS
Jun 19, 2008
147
CA
hi, i just imported ms access to mysql (tables) and now trying to rewrite queries.
can you help me with mysql syntax with these two:

SELECT ZIPLIST.ZIP, ZIPLIST.CITY, ZIPLIST.STATE, ZIPLIST.COUNTY AS ZIPLIST_COUNTY, SNOWLOAD.S, SNOWLOAD.W, SNOWLOAD.Ss, SNOWLOAD.S1, SNOWLOAD.I1, SNOWLOAD.I2
FROM SNOWLOAD, ZIPLIST
WHERE (((ZIPLIST.STATE)=[snowload].[st]) AND ((ZIPLIST.COUNTY)=[snowload].[county]));

it gives me error 1064.

SELECT ZIPLIST.ZIP, ZIPLIST.CITY, ZIPLIST.STATE, ZIPLIST.COUNTY AS ZIPLIST_COUNTY, SNOWLOAD.S, SNOWLOAD.W, SNOWLOAD.Ss, SNOWLOAD.S1, SNOWLOAD.I1, SNOWLOAD.I2
FROM SNOWLOAD, ZIPLIST
WHERE (((ZIPLIST.ZIP)=[enter zip code]) AND ((ZIPLIST.STATE)=[snowload].[st]) AND ((ZIPLIST.COUNTY)=[snowload].[county]));

thanks.
 
get rid of the square brackets, mysql doesn't understand them

if they were required to escape a problematic identifier, such as a table with a space in the name like [My Table], then you will have to escape them with mysql backticks, like `My Table` (of course, it's best not to have names like that in the first place)

mysql does not prompt like access does for things like [enter zip code]

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
thanks, it works now

SELECT ZIPLIST.ZIP, ZIPLIST.CITY, ZIPLIST.STATE, ZIPLIST.COUNTY AS ZIPLIST_COUNTY, SNOWLOAD.S, SNOWLOAD.W, SNOWLOAD.Ss, SNOWLOAD.S1, SNOWLOAD.I1, SNOWLOAD.I2
FROM SNOWLOAD, ZIPLIST
WHERE ((ZIPLIST.STATE=snowload.st) AND (ZIPLIST.COUNTY=snowload.county));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top