Next Sorting Problem (1 Viewer)

ConnorGiles

Strange Traveller
Local time
Today, 15:09
Joined
Aug 12, 2014
Messages
1,068
Hey Again Guys,

Next problem is,

I wish to sort my product column so that products that are meant to be together appear next to each other. This can be achieved through sorting via the Primary key ID since they are entered together usually.

But when I add ID into my query - The column named Number of Dups (shortens the amount of times a product appears by giving a number of times the product appeared) stops counting them and displays them as one.

I'm assuming it is because ID is seperating the products due to their ID's being different each time.

My question is - Is there a way I can sort my list through ID, and count the product at the same time?

Thanks in Advance.
 

BlueIshDan

☠
Local time
Today, 11:09
Joined
May 15, 2014
Messages
1,122
subquery.

Code:
SELECT 
	tblSomething.*, 
	qryCount.Count 
FROM 
	tblSomething, 
	(
		SELECT 
			[link_field], 
			COUNT([field]) 
		FROM 
			tblSomething 
		GROUP BY 
			[link_field], 
			[field]
	) as qryCount

WHERE  tblSomething.[link_field] = qryCount.[link_field]
ORDER BY tblSomething.id
 

Users who are viewing this thread

Top Bottom