Answered
Complex Query Question
I am doing a 9-1-1 reporting system. I am selecting calls by
Agency and type of call for a given month. That works fine, but I
need them printed in desending sequence by number call far a call
type. Don't see anyway to accomplish that with one query.
Is that a way? If not, the second part of this question is that I have not created a table using SQL. I need 3 fields, Field_A is Text (9 positions); Field_B is Text (40 Positions) and the last is my summarized count from the query. How do I create a Table to support this function?
Query
<cfquery name="GetEventCount" datasource="JasperCountyDB">
select count(AG_ID) as EventCount, TYCOD, TYP_ENG, CURENT
from aeven
where ((AG_ID = '#Session.InquiryAgencyCode#')
AND (CURENT = 'T') AND (CDTS LIKE '#EventReportDate#'))
group by AG_ID, TYCOD, TYP_ENG, CURENT
</cfquery>
Thanks for any guideance that you can provide.
Ron
Is that a way? If not, the second part of this question is that I have not created a table using SQL. I need 3 fields, Field_A is Text (9 positions); Field_B is Text (40 Positions) and the last is my summarized count from the query. How do I create a Table to support this function?
Query
<cfquery name="GetEventCount" datasource="JasperCountyDB">
select count(AG_ID) as EventCount, TYCOD, TYP_ENG, CURENT
from aeven
where ((AG_ID = '#Session.InquiryAgencyCode#')
AND (CURENT = 'T') AND (CDTS LIKE '#EventReportDate#'))
group by AG_ID, TYCOD, TYP_ENG, CURENT
</cfquery>
Thanks for any guideance that you can provide.
Ron
