victoria_1018
12-13-2002, 04:06 AM
Hi All,
I have some difficulties in writing a SQL Query for my ASP Query Page
This query will select information from two tables, namely WorksOrder and WorksOrderReport.
I want my result to display record in WorksOrder and records in WorksOrderReport provided StatusOfWork for one of the records in WorksOrderReport = ¡®Completed¡¯, otherwise, do not display any records from both tables.
Currently, I am usingINNER JOIN to write the SQL Query but it did not display the result I want.
My SQL Statement:
SELECT * FROM WorksOrder w WHERE w.WorksOrderNo = ¡®¡±&SearchWorksOrderNo&¡±%¡¯ INNER JOIN SELECT * FROM WorksOrderReport wor WHERE w.WorksOrderNo = wor.WorksOrderNo AND wor.StatusOfWork = ¡®Pending¡¯ AND StatusOfWork = ¡®RMA¡¯ AND StatusOfWork = ¡®Completed¡¯;
Does anyone know how to write it?
Regards
Victoria
I have some difficulties in writing a SQL Query for my ASP Query Page
This query will select information from two tables, namely WorksOrder and WorksOrderReport.
I want my result to display record in WorksOrder and records in WorksOrderReport provided StatusOfWork for one of the records in WorksOrderReport = ¡®Completed¡¯, otherwise, do not display any records from both tables.
Currently, I am usingINNER JOIN to write the SQL Query but it did not display the result I want.
My SQL Statement:
SELECT * FROM WorksOrder w WHERE w.WorksOrderNo = ¡®¡±&SearchWorksOrderNo&¡±%¡¯ INNER JOIN SELECT * FROM WorksOrderReport wor WHERE w.WorksOrderNo = wor.WorksOrderNo AND wor.StatusOfWork = ¡®Pending¡¯ AND StatusOfWork = ¡®RMA¡¯ AND StatusOfWork = ¡®Completed¡¯;
Does anyone know how to write it?
Regards
Victoria