Forum Discussion

Sherry_Morris's avatar
Sherry_Morris
Qrew Member
4 hours ago

Help! Formula Query with multiple conditions.

My query is not returning any value for records that meet the conditions.

ToNumber(ToText(GetFieldValues(GetRecords("{86.EX.'"&true&"'}" & "{15.EX.'"&[mhe_type]&"'}", [_DBID_BTS_METRICS]), 10)))

I need to return the field value (fid 10) from the table [_DBID_BTS_METRICS] when field ID 86 in the queried table is true (checkbox is checked) and the value in field ID 15 is equal to the value in the field [mhe_type] in the querying table.

I have tried:

  • punctuation, format, etc numerous times
  • using a text field to give the checkbox a yes/no value and using that field (fid 89) in the conditions in case it is the checkbox giving me the problem
  • changing it to a SumValues query, but then it returned a value of 0.

2 Replies

  • are you trying to SUM a numeric valid in field ID 10.

    If so, try this

    var text QUERY = "{86.EX.1}AND{15.EX.'" & [mhe_type] & "'}";

    SumValues(

    GetRecords($QUERY, [_DBID_BTS_METRICS]), 10)

  • Mez's avatar
    Mez
    Qrew Captain
    Sherry_Morris wrote:

    {86.EX.'"&true&"'}

    Just for clarity, this use of true results in nothing. You'd want to structure it this way: {86.EX.'true'} or as Mark has noted below, 1, since a checkbox field is either 1 or 0. 

    And if this formula field for this query is numeric, SumValues() is your ticket.