Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Date Literals not working as expected
Wed, Jul 16 2014 11:16 AMPermanent Link

Michael

Have this query:

Select BlockID, ResourceID, StartTime, EndTime from EventScheduleBlock
where ScheduleDate is null and ScheduleDate >= '2014-07-16' and "ResourceID" = 0 Order by StartTime

ScheduleDate is a date field.

The query does not work, it gives this error:

ElevateDB Error #700 An error was found in the statement at line 2 and column 48 (Expected Date or Timestamp expression but instead found '2014-07-16')

However, this does work:

Select BlockID, ResourceID, StartTime, EndTime from EventScheduleBlock
where ScheduleDate is null and ScheduleDate >= Cast('2014-07-16' as Date) and "ResourceID" = 0 Order by StartTime

However, the manual here..
http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Date_Time_Types
..says it should, the way I read it.

Is the bug in ElevateDB or the manual?

Thanks,

Michael
Wed, Jul 16 2014 2:24 PMPermanent Link

Uli Becker

Michael,

ScheduleDate >= '2014-07-16'

should be

ScheduleDate >= date '2014-07-16'

You have to tell EDB, that the string is a date.

Uli
Image