Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with SQL Queries

Status
Not open for further replies.

JavaToPerlNowVB

Programmer
Joined
Jul 14, 2005
Messages
84
Location
US
I have these two queries and I would like to add "Units Inspected" column, which is in the second query to the first query. Is there away to do that, How could i do so...

Here are the queries

Code:
TRANSFORM Count(GISADM_GNDLINEFACILITYMAINTPOLE.GLFWM_MDB_KEY) AS CountOfGLFWM_MDB_KEY
SELECT DatePart("yyyy",[INSPECTDATE]) AS InspectionDate
FROM GISADM_GNDLINEFACILITYMAINTPOLE
GROUP BY DatePart("yyyy",[INSPECTDATE])
ORDER BY DatePart("yyyy",[INSPECTDATE])
PIVOT GISADM_GNDLINEFACILITYMAINTPOLE.MAINTACTION;

Code:
SELECT DatePart("yyyy",[INSPECTDATE]) AS [Inspection Year], Count(GISADM_INSPECTIONDATAPOLE.OBJECTID) AS [Units Inspected]
FROM GISADM_INSPECTIONDATAPOLE
GROUP BY DatePart("yyyy",[INSPECTDATE])
ORDER BY DatePart("yyyy",[INSPECTDATE]);
Thanks alot
 
Out put of this query gives me four columns according to the actions that i have used to group. Is it possible for me to get a total(sum up) for each column at the end of each.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top