Hi, I don't know for sure but I suspect your problem has something to do with date format. At the time the page is rendered '${dtDateToCompare}' gets translated into a string (using toString if it's not already a string). The date format used (explicitly by you or implicitly by toString) may not match the one used by your DB. If this is the case then I see 2 solutions: * find out the date format used by your DB (a simple select on a table having a date field might do) and format the dtDateToCompare correspondingly * replace '${dtDateToCompare}' with a parameter using ? (the JDBC syntax) or :paramName (HQL syntax) and call the corresponding searchDocuments method. I hope this helps, Marius
Hi everyone, having a small problem on an HQL query (and hope someone's managed to get this working before)
NOTE: $dtDateToCompare is yesturdays date, generated with groovy
select obj.name from BaseObject obj, XWikiDocument doc, StringProperty propnrd where obj.className='XWiki.clickClass' and obj.name<>'XWiki.clickClassTemplate' and obj.name not like('%/%') and doc.fullName=obj.name and propnrd.id.id=obj.id and propnrd.id.name='clickDateAssign' and propnrd.value < '${dtDateToCompare}' order by obj.name asc
This works if I use the modified date property of the document (as a test); but not for a custom date property (propnrd.id.name='clickDateAssign' is a date property of the class).
Anybody do something similar and can share some pointers? Using MySQL if that makes any difference _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users