1 Reply Latest reply on Mar 11, 2014 8:19 AM by philmodjunk

    Query returning "?" instead of values

    gregdc

      Title

      Query returning "?" instead of values

      Post

           I am back with another crazy question.   I have a script with a Set Variable statement as follows:

           Set Variable[$CertYr; Value:GetAsText ( Let ( [$query = "Select Min(Consultant_certification_achieved) from PeopleRole where Person_Id = ?"; $result = ExecuteSQL($query;"";"";$PersonID)] ; $result))]

           But instead of returning a blank or a year it returns "?"  I know that Consultant_certification_achieved is an attribute in People Role.   I have tried this both unqualified (as above) and qualified (PeopleRole::Consultant_certification_achieved).  Both result in "?".     

           Can someone out there see what I am not seeing and why I am getting this result?

           Thanks

           GregDC

        • 1. Re: Query returning "?" instead of values
          philmodjunk

               A question mark result from ExecuteSQL indicates a SQL syntax error in most cases. In other cases, it just means that your field is too narrow to display the data returned by your calculation.

               So you'll need to check the details of your query and also try clicking into the field while in Browse mode. (If field is too narrow, you'll see the results when you click into the field.) I don't see any obvious syntax errors so you may need to double check field names. (I don't think any need quotes but you can also try enclosing the field names in quotes.)

               

                    I have tried this both unqualified (as above) and qualified (PeopleRole::Consultant_certification_achieved).

               The correct syntax for a qualified field reference in SQL is PeopleRole.Consultant_certification_achieved.