user3172446
user3172446

Reputation: 59

CMIS Query : how to get result of one date only

I want to get data from one date only, example: 2014-06-16 in CMIS reference I know that we can use = (equal) operator that I think the time must be precised.

The alternative that i thought is to do like below :

First:

SELECT * FROM cmis:document  WHERE cmis:creationDate >= TIMESTAMP '2014-06-16T00:00:00.000Z' AND  cmis:creationDate< TIMESTAMP '2014-06-17T00:00:00.000Z'

Second:

SELECT P.tsi:DATENUM as date_traitement, L.tsi:type as type, P.tsi:statut as statut 
FROM tsi:lot AS L JOIN tsi:pli AS P ON L.cmis:name = P.tsi:lot 
WHERE 
(P.tsi:DATENUM >= TIMESTAMP '2014-06-16T00:00:00.000Z' AND P.tsi:DATENUM < TIMESTAMP '2014-06-17T00:00:00.000Z')

The first one is running perfectly, I've got data from the 16 june BUT in the seconde I don't know WHY but I still got data from 2014-06-17

Note: tsi:DATENUM type is datetime

So could you say what's wrong OR how to get data from ONE date only?

Upvotes: 0

Views: 2832

Answers (1)

Jeff Potts
Jeff Potts

Reputation: 10538

The second one should work. The timestamps you are using are in GMT. If your timestamps are stored with a time zone offset it could be the reason why you are seeing times from 6/17 when you expect to only see times from 6/16.

Upvotes: 1

Related Questions