Re: [firebird-support] Re: expression evaluation not supported

2012-08-20 Thread Jupiter Punungwe
Thank you very much Jonathan.

I had managed to figure this out about 30 minutes after making the post. I
must admit I was misled by the 'expression evaluation not supported.'
message devoid of any detail.

Apart from this my sojourn with Firebird is progressing well.

Regards
Jupiter

On Sat, Aug 18, 2012 at 11:30 PM, realoldgeek2008 
jonathan.fi...@rocketmail.com wrote:

 **




 Hello Jupiter;

 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:

 ... 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

 Regards,

 Jonathan


 --- In firebird-support@yahoogroups.com, Jupiter Punungwe punungwe.tech@...
 wrote:
 
  I am running this query
 
  SELECT LICENSE_PLATE_NO, IMAGE_NAME FROM table WHERE
 (LICENSE_PLATE_NO'No
  plate found') AND (DATEDIFF(second FROM LAST_MODIFIED_ON TO
  current_time)120)
 
  the aim being to find all records modified in the last two minutes.
 
  I get the error message
 
  '[blah blah blah] expression evaluation not supported.'
 
  Does this mean I cannot put a function in a Firebird SQL statement? I can
  do this in MySQL and SQL Server without any problem. In this particulat
  project, I am forced to use Firebird for legacy reasons.
 
  Regards
  Jupiter
 
 
  [Non-text portions of this message have been removed]
 

  



[Non-text portions of this message have been removed]





++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

* To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[firebird-support] Re: expression evaluation not supported

2012-08-18 Thread realoldgeek2008


Hello Jupiter;

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:
  
... 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


Regards,

Jonathan

--- In firebird-support@yahoogroups.com, Jupiter Punungwe punungwe.tech@... 
wrote:

 I am running this query
 
 SELECT LICENSE_PLATE_NO, IMAGE_NAME FROM table WHERE (LICENSE_PLATE_NO'No
 plate found') AND (DATEDIFF(second FROM LAST_MODIFIED_ON TO
 current_time)120)
 
 the aim being to find all records modified in the last two minutes.
 
 I get the error message
 
 '[blah blah blah] expression evaluation not supported.'
 
 Does this mean I cannot put a function in a Firebird SQL statement? I can
 do this in MySQL and SQL Server without any problem. In this particulat
 project, I am forced to use Firebird for legacy reasons.
 
 Regards
 Jupiter
 
 
 [Non-text portions of this message have been removed]





Re: [firebird-support] Re: expression evaluation not supported

2012-08-18 Thread Paul Vinkenoog
Jonathan wrote:

 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:

 ... 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

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.

http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-intfunc-datediff.html


Cheers,
Paul Vinkenoog