Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4084 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I ran into an odd problem today with ExecuteSQL().  I was trying to run a query that would count things that were NOT set, i.e.:

ExecuteSQL (
    "SELECT COUNT ( ID_pk )
     FROM Updates
     WHERE ID_pk = ?  AND Replaced ≠ ? "
; ""  ; "" ; ParentID ; 1 )

Each parent could have a number of updates, but we only want one active at a time; so if the Update is marked as 'Replaced' then it is no longer active.

 

So my query above was returning a dreaded "?".  However, if I ran THIS query:

ExecuteSQL (
    "SELECT COUNT ( ID_pk )
     FROM Updates
     WHERE ID_pk = ?  AND Replaced = ? "
; ""  ; "" ; ParentID ; "" )

I got the correct result.  So it apparently doesn't want to consider a NULL value as a 'not equal to 1'?  And why didn't it just report 0?  Why the question mark?

 

I will probably define an auto-enter calc to set it to 0 in the first place, but it really seems like this query should work without that having to be defined as something non-empty.

 

Thanks,

J

Posted

Thank you for the links.  The first produces a 404 error until I remove the colon (or is that a semi-colon?) from the end.

This topic is 4084 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.