Joining two queries into one query or making a sub-query

Posted by gary A.K.A. G4 on Stack Overflow See other posts from Stack Overflow or by gary A.K.A. G4
Published on 2010-04-26T15:43:45Z Indexed on 2010/04/26 16:33 UTC
Read the original article Hit count: 352

Filed under:
|

I am having some trouble with the following queries originally done for some Access forms:

SELECT qry1.TCKYEAR AS Yr, COUNT(qry1.SID) AS STUDID, qry1.SID AS MID, table_tckt.tckt_tick_no 
FROM table_tckt INNER JOIN qry1 ON table_tckt.tckt_SID = qry1.SID
GROUP BY qry1.TCKYEAR, qry1.SID, table_tckt.tckt_tick_no 
HAVING (((table_tckt.tick_no)=[forms]![frmNAME]![cboNAME]));

SELECT table_tckt.sid, FORMAT([tckt_iss_date], 'yyyy') AS TCKYEAR, table_tckt.tckt_tick_no, table_tckt.licstate
FROM table_tckt
WHERE (((table_tckt.licstate)<>"NA"));

I am no longer working with Access, but JSP for the forms. I need to somehow either combine these two queries into one query or find another way to have a query 'query' another one.

© Stack Overflow or respective owner

Related posts about sql

Related posts about query