1
votes

I am trying to perform a query to return entities form a azure table based on Timestamp property.

1) I start with getting current time in UTC:

currTime = datetime.utcnow().strftime("%Y-%m-1T%H:%M:%S")

2) Then I perform some steps to generate entries in an azure table

3) Now I want to get those entities with Timestamp greater than currTime obtained in step 1: ... ...

filter = "Timestamp gt datetime.currTime"

tasks = table_service.query_entities('CustomUSBilling', filter = filter)

Error:
azure.common.AzureHttpError: Bad Request {"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"A binary operator with incompatible types was detected. Found operand types 'Edm.DateTime' and 'psci.CustomBilling' for operator kind 'GreaterThan'.\nRequestId:4778896c-0002-0001-14c0-cf1c2f000000\nTime:2017-05-18T10:21:21.0947272Z"}}}

1
Can you print filter and tell us what is the value there?Gaurav Mantri
Timestamp gt datetime.currTimeSandeep Vaidya

1 Answers

1
votes

Please try changing the following line of code:

filter = "Timestamp gt datetime.currTime"

To:

filter = "Timestamp gt datetime'" + currTime + "'"