Ben_Entrew
Registered User.
- Local time
- Yesterday, 16:48
- Joined
- Dec 3, 2013
- Messages
- 177
Hello,
I try to execute following subquery:
DoCmd.RunSQL "SELECT DISTINCT Q_PRICES.Material, Q_PRICES.Product_Class INTO TEST " & _
"FROM Q_PRICES " & _
"WHERE " & _
"(SELECT Q_PRICES.Material " & _
"FROM Q_PRICES " & _
"WHERE Q_PRICES.Valid_to Like '*2017' " & _
"GROUP BY Q_PRICES.Material " & _
"HAVING Count(Q_PRICES.Product_Class)>1) " & _
"GROUP BY Q_PRICES.Material, Q_PRICES.Product_Class"
It replies me this warning message:
At most one record can be returned by this subquery
Basically I wanna find out if there are material numbers with more than one product class name. This shouldn't occur in our data.
Any clue how I can rewrite this?
Thank you.
Regards,
Ben
I try to execute following subquery:
DoCmd.RunSQL "SELECT DISTINCT Q_PRICES.Material, Q_PRICES.Product_Class INTO TEST " & _
"FROM Q_PRICES " & _
"WHERE " & _
"(SELECT Q_PRICES.Material " & _
"FROM Q_PRICES " & _
"WHERE Q_PRICES.Valid_to Like '*2017' " & _
"GROUP BY Q_PRICES.Material " & _
"HAVING Count(Q_PRICES.Product_Class)>1) " & _
"GROUP BY Q_PRICES.Material, Q_PRICES.Product_Class"
It replies me this warning message:
At most one record can be returned by this subquery
Basically I wanna find out if there are material numbers with more than one product class name. This shouldn't occur in our data.
Any clue how I can rewrite this?
Thank you.
Regards,
Ben