JCR SQL2 Query

mrutyunjayd7834

17-04-2019

I am dynamically reading Form Date Field and passing it to JCR SQL2  for CASTING string to DATE , getting illegal parsing error.Please suggest right JCR SQL2 Query for string Date Csting

Accepted Solutions (1)

Accepted Solutions (1)

Gaurav-Behl

MVP

17-04-2019

check  9 JCR-SQL2 Queries Every AEM Developer Should Know - Blog - 6D Global

SELECT p.* FROM [nt:base] AS p WHERE p.[cq:lastModified] >= CAST('2008-01-01T00:00:00.000Z' AS DATE) AND p.[cq:lastModified] <= CAST('2008-12-31T23:59:59.999Z' AS DATE)

or

SELECT p.* FROM [nt:base] AS p
WHERE p.[some_date] >= CAST('2008-01-01T00:00:00.000Z' AS DATE)

  AND p.[some_date] <= CAST('2008-12-31T23:59:59.999Z' AS DATE)

Answers (0)