I have just started using Neo4jClient and Cypher and surprisingly I don't find any example on the net that's using the DateTime filed in the the cypher query where clause .
when I an trying to get some nodes filtered on a DateTime property, the query is not returning any results, here is an example of what I was trying:
Say I am looking for all make employees in HR deportment whose Date of birth is within a time range. the query I am trying to build is as shown below.
client.Cypher
.Start(new { company = companyNode.Reference})
.Match("(department)<-[:BELONGS_TO]-(employee)-[:BELONGS_TO]->(company)")
.Where<Department>(department=>department.Name=='Human Resource')
.AndWhere<Employee>(employee=> employee.DOB >= searchStart && employee.DOB<= searchEnd)
.ReturnDistinct((employee)=> new {name = employee.Name});
here Employee->DOB/searchStart/searchEnd are all DateTimeOffset fields and the data stored in the graph via the neo4jclient is represented as "1990-09-28T19:02:21.7576376+05:30"
when i am debugging the code I see that Neo4jClient is actually representing the query as something like this
AND ((employee.DOB >=10/3/1988 8:16:41 PM +03:00) AND (employee.DOB <=10/3/2003 8:16:41 PM +03:00))
when I get rid of the DOB where clause i do get results.
I would really appreciate if someone can point me to how the DateTimeOffset property can be used in the queries.
Regards, Kiran