I haven't found the problem but I found a way to bypass it. It seems like the times there are multiples entries for the same NIP, the CountNIP result is multiplied the number of times the NIP appears witch I find wierd since I use DISTINCT. Anyway, I made a function to divide CountNIP by the...
Hello again,
Here are a part of the results of my query and expected results by manually counting the NIPs in EF1 and EF2:
NIP CountNIP Expected
2062 9 3
2073 4 1
2264 3 3
2265 1 1
2266 8 2
2267 1 1
2268 5 5
2272 1 1
2274 20 5
I don't know if this changes something but in table1, some NIPs come several times (The primary keys are Fct, NIP, Month and Year). I've already tried DISTINCT(NIP) in the SELECT but I get the same wrong results
Sure, here's some example data:
table1:
Fct NIP Month Year FR FM PS
--------------------------------------------------
2 2266 5 2005 5 0 No
table2:
Form EF1 EF2 Day Month Year Period
----------------------------------------------------------
507 2264 2290...
Hello
I am getting wrong results with my query so I hope you can help me check what the problem is. What I want to do is to count the number of times a field (NIP) is in field EF1 or in field EF2.
Here's my query:
SELECT table1.NIP, Count([table2]![EF1] And [table2]![EF2]) AS CountNIP
FROM...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.