Query result wrong when field is 0 (1 Viewer)

CJ_London

Super Moderator
Staff member
Local time
Today, 14:01
Joined
Feb 19, 2013
Messages
16,614
My apologies for the confusion. The code was listed in original post. Here it is again:
Used the Nz formula and still getting wrong result
We don't need to see the code in the original post, we need to see the code as it is now - i.e. with your use of the nz function
 

ebs17

Well-known member
Local time
Today, 15:01
Joined
Feb 7, 2020
Messages
1,946
Note for readable queries: Fields in calculated expressions should also be qualified, i.e. the table name or alias should be placed in front of them so that you can immediately understand which table a field comes from.
...
Nz(??.[PASSAGE# ], 0) AS [COURSE PASSAGE#],
...

@The_Doc_Man already gave this reference, which often remains unread and misunderstood.
This is a point where you can be smarter than the QBE.
 

cheekybuddha

AWF VIP
Local time
Today, 14:01
Joined
Jul 21, 2014
Messages
2,280
Note for readable queries: Fields in calculated expressions should also be qualified
Absolutely.

But, since we don't know from which tables those fields come, it's a bit difficult.

This is the fault of Access crappy query builder, but at least we know that the fields' names should be unique to a single table.
 

ebs17

Well-known member
Local time
Today, 15:01
Joined
Feb 7, 2020
Messages
1,946
Newbies and many advanced users believe that it is good and right to find out what can be found as an SQL statement by clicking on the possible wizard. With this belief, one accept the result as it is, and it looks as shown - very often.
If one don't look at the SQL statement, it doesn't matter.
 

topdesk123

Registered User.
Local time
Today, 06:01
Joined
Mar 28, 2013
Messages
52
We don't need to see the code in the original post, we need to see the code as it is now - i.e. with your use of the nz function
Using the # sign could be throwing it off. Here's another formula you can try:
IIf([PASSAGE#] <= 0 Or [PASSAGE#] < 5 Or [FAILURE#- ESSA] > 1, "No", "Yes")
 

Users who are viewing this thread

Top Bottom