View Full Version : query database from 2 variables
01-21-2005, 08: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-21-2005, 11:20 PM
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-21-2005, 11:42 PM
thanks, ill try that out and let you know!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.