Just a little stuck with an SQL query. I am trying to pull out all rows with a particular number, but can't seem to get the query working. This is what I am doing:
strQ = "SELECT JobDesc, RepDate, JobStatus "
strQ = strQ & "FROM tbl_Contracts, tbl_Jobs, tbl_Despatch, tble_Customers "
strQ = strQ & "WHERE tble_Customers.recid = '" & request.cookies("passes2" & "' "
strQ = strQ & "AND tbl_Contracts.CustomerId = tble_Customers.recid "
strQ = strQ & "AND tbl_Contracts.recid = tbl_Jobs.ContractId "
strQ = strQ & "AND tbl_Despatch.JobId = tbl_Jobs.recid "
strQ = strQ & "AND tbl_Jobs.JobStatus = "2" " <<<This is the line>>>
I thought this should work, but I am obviously doing somthing wrong. Can somebody shed some light on this for me please. Thank You.
strQ = "SELECT JobDesc, RepDate, JobStatus "
strQ = strQ & "FROM tbl_Contracts, tbl_Jobs, tbl_Despatch, tble_Customers "
strQ = strQ & "WHERE tble_Customers.recid = '" & request.cookies("passes2" & "' "
strQ = strQ & "AND tbl_Contracts.CustomerId = tble_Customers.recid "
strQ = strQ & "AND tbl_Contracts.recid = tbl_Jobs.ContractId "
strQ = strQ & "AND tbl_Despatch.JobId = tbl_Jobs.recid "
strQ = strQ & "AND tbl_Jobs.JobStatus = "2" " <<<This is the line>>>
I thought this should work, but I am obviously doing somthing wrong. Can somebody shed some light on this for me please. Thank You.