- Group Casetype and use dcount function , in SQL (Where test is table
name):
SELECT test.CaseType, DCount("[SipA]","test","[SipA] = 'E' AND
[CaseType]='" & [CaseType] & "'") AS Asip,
DCount("[SipA]","test","[SipA] = 'D' AND [CaseType]='" & [CaseType] &
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14068
"'") AS nAsip, DCount("[SipB]","test","[SipB] = 'E' AND [CaseType]='" &
[CaseType] & "'") AS Bsip, DCount("[SipB]","test","[SipB] = 'D' AND
[CaseType]='" & [CaseType] & "'") AS nBsip
FROM test
GROUP BY test.CaseType;
CON: very slow if here's a lot of records;
PRO: 1 query!
- make multiply querys that count each scenario and join them together
by CaseType
CON: maintaining multiple queries;
PRO: easier to concept - should be faster than above for lots of
records
- temp table isn't bad either - just run a bunch of append/update
queries.
CON: maintaining multiple queries;
PRO: easier to concept - should be faster than above for lots of records
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=14068