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
|
Hi I would like to construct a query with the DateTime.Now first and then the Database Field. I'm unable to find a way to-do this can you please assist? This is the error I'm getting: Error 26 Operator '>=' cannot be applied to operands of type 'System.DateTime' and 'Mindscape.LightSpeed.Querying.PathExpression' Kind regards, Johan |
|
|
No - this isn't possible. Entity.Attribute returns a PathExpression and we have defined a number of operator overloads on that particular type to aid in query construction which means it needs to be on the left hand side of an expression.
|
|
|
Hi Jeremy, How would one then achieve this in LightSpeed? Johan |
|
|
Use:
|
|
|
Well thank you, but this is not really going to work as it's an EffectiveOn Date. That is why I need to know if the Current DateTime is >= EffectiveOn Date. This is why my query is DateTime.Now >= Database Field So I'm I safe to assume that there no other way to achieve this in LightSpeed then? Cheers |
|
|
If you are able to use LINQ you can express this, but there isn't a way of expressing this using the LightSpeed querying API for the reasons mentioned above. I am clearly missing something though, why can you not restructure the above query as Database Field <= DateTime.Now?
|
|