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

including multiple values for single field in statement 1

Status
Not open for further replies.

hererxnl

Technical User
Jul 8, 2003
239
US
I don't know if this is possible but I'm hoping someone does, and I do know this is the place to ask. I'm using a variation of the following statement to return a record set:
Code:
sql = "SELECT [Job#] & ', ' & [UserID] & ', ' & [Priority] & ', ' & [Delivered] AS [strJobs] FROM [Job] WHERE [UserID]=x, x, x [Account#]=" & objAcct & " AND [Dept#]=" & objDept & " AND [Status]='Delivered' AND [Delivered] BETWEEN #" & objStartDate & "# AND #" & objEndDate & "# ORDER BY [UserID], [Delivered];"
The [UserID] field is where I'm having problems, I'm not using that piece as it's shown above. I'm hoping there is a way to include results from say 2 users while omitting the rest. The recordset is populating a table in a vbscript asp page and will return 100+ records for any user. That said I don't want to break up the queries and involve more than one recordset as it will trash my paginating scheme.

Anyone got the answer?

Thanks in advance, Jeff
 
WHERE [UserID] IN (x, y, z) AND [Account#].....

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Thanks so much. I actually included the AND in the real code but was just substituting what I was after in place of the loop and conditionals. I had tried IN but was getting errors because I was encasing the values in single quotes.

Thanks again Leslie, a star for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top