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'm trying to perform a query (either LINQ or 'classic'), but I think it might be one where I need a join ,so won't be able to do it until 3.0, but thought I'd check as I could be overlooking something. I have one table with a list of fixed values that are shown in a drop down in the front end winforms app.The selected value is used as a parameter to a report. For certain reports, not all the fixed values are relevant, so there is another table attached to it that has the drop down item id and a Report Id for all items that are NOT used by that Report. It was done this way, since around 75% of the Reports use all the fixed values. So what I need to do is return all items in Table A where Table A Id is not in Table B for a particular Report Id in Table B. Currently I am pulling back two queries into two lists then deleting the items in List A that exist in List B which is a bit clunky. Any thoughts ?
Paul |
|
|
|
|
Try: Find<A>(!(Entity.Attribute("Bs.ReportId") == myid)); I'm not promising anything because I don't have a test case that's quite what you're asking for, but this appears to work for a fairly similar test case so it's worth a quick go! NOTE: C# syntax notwithstanding, !(Entity.Attribute("Bs.ReportId") == myid) is NOT the same as (Entity.Attribute("Bs.ReportId") != myid) -- the former should find all As except those which have a B whose ReportId is myid, i.e. all As which have no B whose ReportId is myid, the latter will find all As which have some B whose ReportId is not myid. |
|
|
|
|
Ahh, not familiar with that syntax. I'll give it a whirl when I have some time. Thanks Ivan. |
|
|
|