Thread: QUery Problems

    #1
  1. No Profile Picture
    Contributing User
    ASP Good Citizen (1000 - 1499 posts)

    Join Date
    Feb 2005
    Posts
    1,280
    Rep Power
    36

    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 & "' "
  2. #2
  3. No Profile Picture
    Contributing User
    ASP Good Citizen (1000 - 1499 posts)

    Join Date
    Feb 2005
    Posts
    1,280
    Rep Power
    36
    Got it

    SQLQuery = "SELECT * FROM wdWRMainGeneral WHERE Requestor = '" & varRequestType1 & "' OR Requestor = '" & varRequestType2 & "' AND Status = '" & varStatus & "' "

Similar Threads

  1. Query Problems
    By relaxedbreeze in forum Microsoft Access Help
    Replies: 3
    Last Post: February 20th, 2007, 05:03 AM
  2. Problems with a Query!!
    By balwani_prem in forum ASP Development
    Replies: 2
    Last Post: February 23rd, 2005, 05:11 PM
  3. Query Problems
    By Jimbo78 in forum ASP Development
    Replies: 15
    Last Post: May 19th, 2004, 01:43 AM
  4. Pls Help! Problems with Query
    By aleks in forum ASP Development
    Replies: 1
    Last Post: February 11th, 2003, 11:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo