Skip to main content
rahulp98334696
March 4, 2016
Question

CAST string data to Decimal in jcr SQL2 query

  • March 4, 2016
  • 0 replies
  • 970 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.