View Full Version : query database from 2 variables
01-21-2005, 09:56 PM
how would i go about searching an access database for 2 variables such as Company name and Town/Area
Any ideas? Thanks
01-22-2005, 12:20 AM
mySqlQuery = "SELECT * FROM myTable WHERE company = 'companyName' AND town = 'townName'"
Since you most likely won't know the names of the the company or the town then change to this
dim strCompany, strTown
strCompany = Request("company")
strTown = Request("town")
mySqlQuery = "SELECT * FROM myTable WHERE company = '" & strCompany & "' AND town = '" & strTown & "'"
01-22-2005, 12:42 AM
thanks, ill try that out and let you know!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.