Select Problem------------------------------------

Results 1 to 3 of 3

Thread: Select Problem------------------------------------

  1. #1
    Kevin Guest

    Default Select Problem------------------------------------

    I have a problem that at this time I cannot fix.<BR>I&#039m trying to view info on a page based upon 2 conditions. I have a clients, hardware, and software table. I want to view all fields in the software table based upon the clientID and the hardwareID. The software, and hardware tables contain both of these fields (HardwareID, ClientID). The software, hardware, and clients table contain the clientID. This is my rotten code. Can someone tell me what is wrong. I&#039m getting an error saying-------- Syntax error (missing operator) in query expression &#039WHERE S.HardwareID = AND H.HardwareID = AND C.ClClientID =&#039. <BR><BR><BR>sql= "Select S.Software, S.Version, S.DateInstalled, H.HardwareID, C.ClClientID "<BR>sql=sql & "from tbl_Software S, tbl_Hardware H, tbl_Clients C "<BR>sql=sql & "WHERE S.HardwareID = " & Request("S.HardwareID") & " "<BR>sql=sql & "AND H.HardwareID = " & Request("H.HardwareID") & " "<BR>sql=sql & "AND C.ClClientID = " & Request("C.ClClientID") & " "<BR>Response.Write sql<BR>set rs2=cnn.Execute(sql)<BR><BR>

  2. #2
    Delirium Guest

    Default RE: Select Problem--------------------------------

    what does the response.write produce?<BR><BR>Perhaps the request("S.HardwareID") etc are empty?<BR><BR>D.

  3. #3
    Kevin Guest

    Default RE: Select Problem--------------------------------

    The response.write is just an error handler to see what appears from the select info. I&#039m just tring to find out how to join 3 tables based upon 2 different things. I have a HardwareId in the software and hardware tables and clientID in all 3 tables. So far I have this: I need to join in the clientID based upon all 3 tables.<BR><BR>Select S.Software, S.Version, S.DateInstalled, H.HardwareID <BR>from tbl_Software S, tbl_Hardware H<BR>S RIGHT JOIN H ON S.HardwareID = H.HardwareID<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts