Subject | Re: [firebird-support] Re: expression evaluation not supported |
---|---|
Author | Paul Vinkenoog |
Post date | 2012-08-18T22:26:40Z |
Jonathan wrote:
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-intfunc-datediff.html
Cheers,
Paul Vinkenoog
> Sorry you are forced to use something as great as Firebird :-). I assume LAST_MODIFIED_ON is a TIMESTAMP field in your table and is being updated via a trigger or some other mechanism as records are modified. Your DATEDIFF syntax is incorrect; try:This should work, but it's not Jupiter's syntax that was incorrect. The FROM .. TO syntax is fully supported. Point is, you're not allowed to mix TIME and TIMESTAMP arguments with DATEDIFF (DATE and TIMESTAMP is OK though). So, since LAST_MODIFIED_ON is obviously a TIMESTAMP, current_time should be current_timestamp - as in your corrected example.
>
> ... WHERE LICENSE_PLATE_NO<>'No plate found' AND DATEDIFF(second,LAST_MODIFIED_ON,current_timestamp)<120
>
> or
>
> ... WHERE LICENSE_PLATE_NO<>'No plate found' AND DATEDIFF(minute,LAST_MODIFIED_ON,current_timestamp)<2
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-intfunc-datediff.html
Cheers,
Paul Vinkenoog