0 Replies Latest reply on Mar 4, 2016 4:24 AM by rahulp98334696

    CAST string data to Decimal in jcr SQL2 query

    rahulp98334696

      Hi All ,

       

      I am new to AEM and jcr queries. I have a requirement where I need to query the data using jcr sql.

      I have a field call price whose type is String and I want to find out if that price falls between a certain range . I want to write a query which will fetch this node.

      below is the query that I am trying,

       

      SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/items]) and price >CAST ('1' AS DECIMAL) and price <CAST ('8' AS DECIMAL).

       

      Can any one suggest me what am I doing wrong.

       

      Thanks in Advance