cancel
Showing results for 
Search instead for 
Did you mean: 

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

Accepted Solutions (1)

Accepted Solutions (1)

Snavi
Active Participant
0 Kudos

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

Answers (4)

Answers (4)

Snavi
Active Participant
0 Kudos

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

0 Kudos

Hi Navdeep

That's great, thanks a lot for your help.

Cheers

Jonathan

0 Kudos

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

0 Kudos

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

Snavi
Active Participant
0 Kudos

Hi Jonathan,

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

-Navdeep