Strange behavior of query

bknight
BronzeLounger
Posts: 1379
Joined: 08 Jul 2016, 18:53

Strange behavior of query

Post by bknight »

Hey guys I have a strange behavior in an otherwise normal query

Code: Select all

SELECT (Year([Filled])) AS [Year], (Month([Filled])) AS [Month], Sum(Trades.Dividends) AS Dividend
FROM Trades
GROUP BY (Year([Filled])), (Month([Filled])), Trades.Type
HAVING ((((Year([Filled])))=2022) AND ((Trades.Type)="Dividend"));
You'll notice that Jun 22 is blank and yet there is a record on 6/6. Any thoughts?


The othere list query is

Code: Select all

SELECT Trades.Symbol, Trades.Filled, Trades.Entered, Trades.Dividends
FROM Trades
WHERE (((Trades.Dividends)<>0))
ORDER BY Trades.Filled DESC , Trades.Entered DESC , Trades.Symbol;

You do not have the required permissions to view the files attached to this post.
Last edited by bknight on 08 Jun 2022, 13:53, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Strange behavior of query

Post by HansV »

We cannot see Trades.Type in your screenshots.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1379
Joined: 08 Jul 2016, 18:53

Re: Strange behavior of query

Post by bknight »

Ok. Dividends is the far right field(not shown)
You do not have the required permissions to view the files attached to this post.

bknight
BronzeLounger
Posts: 1379
Joined: 08 Jul 2016, 18:53

Re: Strange behavior of query

Post by bknight »

Never mind I just saw the problem, sorry for the inconvenience.

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Strange behavior of query

Post by HansV »

:thumbup:
Best wishes,
Hans