TOPIC: Functions in query expressions
#134
Functions in query expressions 4 Years, 5 Months ago
Hi, why I cannot use object methods in query expressions? I would like to do a query like:

mytable where datefield.Year()=2006

but it goes in syntax error. I presume that queries don't support object methods.

The user's manual is not very helping on this topic, but fortunately I have managed to resolve in this way:

1) In my library I define a global function 'Year' like this:

function(date) { return date.Year() }

2) For the query I write:

mytable where Year(datefield)=2006

In this way it's working, but I don't know if this is the better way.
 
 
Mauro
 
#135
Re:Functions in query expressions 4 Years, 5 Months ago
Sorry - improving queries to handle method calls is on my wish list.

You have found the work-around for now.
 
 
andrew