- Total Members: 219,993
- Threads: 525,379
- Posts: 976,963
-
December 13th, 2012, 11:09 AM
#1
QUery Problems
I am trying to query a dataset and having issues....Query 1 and Query 2 work below fine...
But trying to combine them and Query 3 is failing/coming up with wrong number of records.
Can anyone see anything wrong with it?
Thanks
Dim varRequestType1,varRequestType2, varStatus
varRequestType1 = "Web Requestor"
varRequestType2 = "Your Request"
varStatus = "Planned"
Dim myConn, Recordset,SQLQuery
QUERY 1
SQLQuery = "SELECT * FROM wdWRMainGeneral WHERE Requestor = '" & varRequestType1 & "' AND Status = '" & varStatus & "' "
QUERY 2
SQLQuery = "SELECT * FROM wdWRMainGeneral WHERE Requestor = '" & varRequestType2 & "' AND Status = '" & varStatus & "' "
QUERY 3
SQLQuery = "SELECT * FROM wdWRMainGeneral WHERE Requestor = '" & varRequestType1 & "' OR Requestor = '" & varRequestType2 & "' AND Status = '" & varStatus & "' "
-
December 13th, 2012, 11:15 AM
#2
Got it
SQLQuery = "SELECT * FROM wdWRMainGeneral WHERE Requestor = '" & varRequestType1 & "' OR Requestor = '" & varRequestType2 & "' AND Status = '" & varStatus & "' "
Similar Threads
-
By relaxedbreeze in forum Microsoft Access Help
Replies: 3
Last Post: February 20th, 2007, 05:03 AM
-
By balwani_prem in forum ASP Development
Replies: 2
Last Post: February 23rd, 2005, 05:11 PM
-
By Jimbo78 in forum ASP Development
Replies: 15
Last Post: May 19th, 2004, 01:43 AM
-
By aleks in forum ASP Development
Replies: 1
Last Post: February 11th, 2003, 11:10 AM