I’m not sure why this isn’t working today, I’ve done very similar a few times… a simple subquery in my select statement. Here’s what I’m trying to do:
SELECT TradeDate, Symbol, (SELECT COUNT(Symbol)
FROM tblDailyPricingAndVol AS T2 WHERE T2.TradeDate = TradeDate
AND T2.Symbol = Symbol) AS CountOf
FROM tblDailyPricingAndVol WHERE CountOf >1
ORDER BY TradeDate, Symbol
tblDailyPricingAndVol is a table with relevant fields TradeDate and Symbol… so there is a record for each symbol, for every trading day (for the most part).. I’d like my query to return the number of duplicates for a trade day, or all trade dates with the count of symbols that have more than one record for that date. Hope that makes sense.. thanks.
try this..