help with query
hey guyz...am a newbie to sql....
i got this table in MS access which has got all the airport codes.........
the name of the table is Airport_codes...
the column names in the table are.....Airport_code, Airport_name, State, Country......so my problem is what would be the query to get any airport code.....for example
when i type cmh in the search box it should bring up port columbus intl airport .....
like this i should be able to bring up any airport code jss by typin the code in the search box....i hope u got my point....i know this is a dumb question...but am a newbie...am quite confused...hope someone will help me out with this.....thanx guyz......
From the sounds of it you'll need to use the where clause:
select * from airport_codes where airport_code = your value
brandoe ....whats the my value....is it the name of the form or what.....plz help me man.....
It's the airport_code ( or whatever you type) in your example it would be 'cmh':
select * from airport_codes where airport_code = 'cmh'
hey brandoe thanx man...got it....hey man....one more question....i was able to bring up the airport code which i want..but is there any way i can bring up even if i type in the country.....like
if i type USA..it should bring up all the airport codes in USA.....thanx for the help man...appreciate it.....
Switch the field from airport_code to country:
select * from airport_codes where country = 'USA'
since you are using ACCESS this does not belong in the MySQL forum, I'll move it into the general database discussion forum.