azurenosqlazure-cosmosdb

Datediff in CosmosDb


Hi There is there a way to achieve the datediff in a cosmosdb?

Select Datediff(day,c.datea, c.dateb) from c

Apparently the datediff is not a supported key word and i cant find a equivalent.

Thanks in Advance


Solution

  • There is NO datediff available with cosmosdb,

    Instead you can use where clause if you want to query between two date ranges.