Skip to Content
avatar image
Former Member

HANA Cloud Integration OData Query

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

log.png (8.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Oct 13, 2016 at 09:35 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 13, 2016 at 05:28 AM

    Hi Jonathan,

    Can you put a screenshot of the filter condition, and what is the expression in 'lastModifiedWithTZ'

    -Navdeep

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2016 at 02:32 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2016 at 01:56 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 16, 2016 at 06:37 AM

    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

    Add comment
    10|10000 characters needed characters exceeded