Zum Hauptinhalt gehen

Query Task Where Clause with Integers

Kommentare

2 Kommentare

  • Permanently deleted user
    Hi Denise,

     

    Is "MinAge <= userAgeInt AND MaxAge >= userAgeInt" what you are having in the “where” argument of the QueryTask?

     

    If that’s the case the query task expects that both “MaxAge” and “userAgeInt” are attributes of your map service and tries to compare those attributes. This also explains why if you hardcode values  it works.

     

    I think the syntax for your scenario should be

     

    "MinAge <= “ & userAgeInt & “ AND MaxAge >= “ & userAgeInt

     

    This is not limited to integer but as general rule. If your values were strings you might need to wrap values in single quotes but for your scenario it should be plain as above.

     

    I hope this helps

     

     
    0
  • Denise Beckham
    Francesca,

     

    That did the trick! It works now! Thank you so much! I figured it was something like that, but I am very new to VB script. Thank you again!
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.