on 2016 Oct 12 6:28 PM
Hi
I'm building an interface in HCI using the OData adapter. I've created a filter condition in the Query builder that compares 2 dates (I realise that if it worked no records will be selected, but humour me!), but I keep getting an error 'wrong literal format for literal:'.
See attached screenshots.
It's probably something simple. So please put me out of my misery!
Thanks
Jonathan
Hi Jonathan,
The value in the 'lastModifiedWithTZ' is it in the same format as your property currentDateTime.
I think you have an expression in currentDateTime as yyyy-MM-dd'T'HH:mm:ss'Z' , try changing it to yyyy-MM-dd'T'HH:mm:ssZ
-Navdeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jonathan,
The valid date formats that you can use are as permitted by java.text.SimpleDataFormat (examples : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html)
You need to check the date format returned from the Odata service and use the same format in your properties expression
Cheers,
Navdeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Navdeep
I still get the error message, but I think your on the right track. The two values I'm comparing are in different formats. Do you know where I can find a list of all the valid datetime formats?
Thanks
Jonathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Navdeep
Thanks for getting back to me. This is my OData query.
User?$select=cellPhone,city,country,dateOfBirth,division,email,firstName,gender,hireDate,lastModified,lastName,location,nationality,userId&$filter=lastModifiedWithTZ > datetime'${property.currentDateTime}'
'lastModifiedWithTZ' is a field from the entity User.
Cheers
Jonathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jonathan,
Can you put a screenshot of the filter condition, and what is the expression in 'lastModifiedWithTZ'
-Navdeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.