query question

  • Thread starter Thread starter cdolphin88
  • Start date Start date
C

cdolphin88

Hi,

I have a table with fields artefact (text), not_damage (text)

but i need to write a query so it can shows me which artefact and also
count the number of artefact that is damage and not damage... how can I
do that?

For example, if I have artefact Audio not_damage = yes and artefact CD
not_damage = no, my query result should be like this:

artefact number of items not damage number of items damage
Audio 1
0
CD 0
1


I only manage the query to show me either damage or not damage... not
like this...

can someone help me?

Cheers

C
 
SQL statements would look like

SELECT artefact
, Count(IIF(Not_Damage = "Yes",1,Null)) as CountYes
, Count(IIF(Not_Damage = "No",1,Null)) as CountNo
FROM Table
GROUP BY artefact

If you don't need that all in one row
SELECT artefect, Not_Damage, Count(Not_Damage) as Count
FROM Table
GROUP BY artefect, Not_Damage

If you don't know how to use an SQL statement,but can only use the grid to
build a query and can't figure out what to do with the grid, post back.
 
Back
Top