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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi parameter data searches

Status
Not open for further replies.

baileyhp

Programmer
Sep 26, 2001
26
US
Ok my old age may beginning early. Somewhere in the past few years I created a SQL search in VB for multiple parameters. I just can't find the old code. I want to search for data that has two(2) user input searches.
ie
table where lastname = strentry and where firstdate = thisdate
strentry and thisdate are user entered. I can't remember the proper single - double quote placement.
Any help is GREATLY appreciated
thanks
hb
 
For an Access database, try;

where lastname = '" & strentry & "' and where firstdate = #" & thisdate & "#"

For a SQL Server database, try;

where lastname = " & strentry & " and where firstdate = '" & thisdate & "'"
Thanks and Good Luck!

zemp
 
I tried the code you reccemmended still gives me eror 3075 missing operator
Here is code?:
SQL$ = "Select * FROM ClaimsDataEntry where VendorNumber = '" & Form19.Text1.Text & "' And where Dateofservicefrom = #" & Form19.DTPicker1.Value & "#"
msgbox shows proper date
Thanks
hb
 
Take out the second WHERE
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top