This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello,
I'm trying to figure out how to compare a date field to a date value using the Oracle to_date() function. Ideally the SQL would look like this: to_date(createdon, 'DD/MM/YY') >= to_date('25/10/2009', 'DD/MM/YY).
I'm currently creating a FunctionExpression as the right-hand operand, but this is generating an exception. My code is as follows:
var pathExp = new PathExpression("createdon"); QueryExpression queryExp = pathExp.Function("to_date", new[] { "DD/MM/YY" }) >= CreateFunctionExpression(dateValue) // CreateFunctionBLOCKED EXPRESSION returns a FunctionExpression which will represent the following SQL // to_date(dateValue, 'DD/MM/YY') Thanks Tim
|
|
|
You don't say how you're creating the right-hand expression or what exception you're getting, but I think the fundamental problem is probably that LightSpeed doesn't support functions on literals, only on columns. So there's no way to actually express that RHS operand in LightSpeed. You'd instead need to perform the client-side equivalent, and feed the results to LightSpeed: string formattedDate = dateValue.ToString("dd/MM/yy"); (Apologies if I've misunderstood the semantics of the Oracle to_date function, but hopefully this gives you the general idea anyway.) |
|