Jump to content

ExecuteSQL Issues


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

Recommended Posts

Hi all.  

I am having a horrible time trying to fumble my way though what should be a simple ExecuteSQL calculation.   I'm trying to count the number of records in the ACCOUNT table that have the value of "Bergen" in the field called CountyName.   

Am I doing something wrong, the calc isn't working.  i've tried single and double quotes around the field value of Bergen and it doesn't change anything.  

Thank you in advance for looking and trying to help me.  

Chris

 

 

ExecuteSQL ( "

SELECT Count (id)

FROM Account

WHERE CountyName = Bergen "

;"";"")

Screen Shot 2022-12-23 at 12.34.41 PM.png

Link to comment
Share on other sites

Hi,

It may be best like that :

ExecuterSQL ("SELECT COUNT (Id) FROM Account Where CountyName = ?" ; "" ; ¶; "Bergen") ?

Happy Christmass

G

 

Link to comment
Share on other sites

1 hour ago, CKonash said:

i've tried single and double quotes around the field value of Bergen and it doesn't change anything.  

String literals need to be enclosed in single quotes - e .g. 

WHERE CountyName = 'Bergen'

If that doesn't change anything then there is something else you've left out. At the very least it should change the error message.

 

Edited by comment
Link to comment
Share on other sites

This topic is 462 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.