Access/SQL question

Log in to stop seeing adverts

Status
Not open for further replies.

Darth Vodka

Well-Known Member
allo

anyone know how to do an aggregate function that counts unique records?

?

btw count(DISTINCT fldWhatEver) works in transact SQL but not Access SQL

ho hum
 
Last edited:
allo

anyone know how to do an aggregate function that counts unique records?

?

btw count(DISTINCT fldWhatEver) works in transact SQL but not Access SQL

ho hum

Something like this? :102: :102:

SELECT PastCashFlows.VAL, PastCashFlows.ECH, PastCashFlows.ART, PastCashFlows.PU1, PastCashFlows.PU2
FROM PastCashFlows
WHERE (((PastCashFlows.VAL) In (SELECT [VAL] FROM [PastCashFlows] As Tmp GROUP BY [VAL] HAVING Count(*)=1 )))
ORDER BY PastCashFlows.VAL;
 
Aaah right. Well, I'm glad we got that one cleared up. :):confused:
 
Something like this? :102: :102:

SELECT PastCashFlows.VAL, PastCashFlows.ECH, PastCashFlows.ART, PastCashFlows.PU1, PastCashFlows.PU2
FROM PastCashFlows
WHERE (((PastCashFlows.VAL) In (SELECT [VAL] FROM [PastCashFlows] As Tmp GROUP BY [VAL] HAVING Count(*)=1 )))
ORDER BY PastCashFlows.VAL;

thanx for that

i can what you're up to, but the WHERE would mess my particular one up as i need to count up non unique as well :)

i've actually done it with 2 queries (essentially the same as nesting another SELECT in there i suppose)

i'm a bit gutted that Access doesn't support COUNT ( DISTINCT... cos that was exactly what i wanted

thanx again
 
Status
Not open for further replies.
Log in to stop seeing adverts

Championship

P Pld Pts
1Leicester4697
2Ipswich4696
3Leeds Utd4690
4Southampton4687
5West Brom4675
6Norwich City4673
7Hull City4670
8Middlesbro4669
9Coventry City4664
10Preston 4663
11Bristol City4662
12Cardiff City4662
13Millwall4659
14Swansea City4657
15Watford4656
16Sunderland4656
17Stoke City4656
18QPR4656
19Blackburn 4653
20Sheffield W4653
21Plymouth 4651
22Birmingham4650
23Huddersfield4645
24Rotherham Utd4627
Top