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 all, I'm still using LS 1 for our application, and I won't be able to upgrade for a couple of months. Is it possible to perform a MAX query? For instance I need to select the newest (maxium) record by created date where my username is 'foo'. Is it possible to do that? I have something like the following, but I'm not sure if this will work equivalently in LS 1. select top 1 * from Foo where Foo.username = 'test1234' order by CreatedDate desc
Here is my LS Code
Query query = new Query(); |
|
|
Yes, the sample code you have there should (I believe) work in LightSpeed 1, and it will retrieve the record whose Username is "foo" and which has the maximum CreatedDate as you require. Note however that in LS1 you cannot actually use the SQL MAX keyword (which would be relevant if you were carrying out a projection for example) -- but that is not necessary in your case, as a simple order-by plus limit will do the job. |
|