Thanks Peter. That could be considered but the part I asked about was only part of the query, In reality it had more parts to the query. Where essayWordCount is an long integer.
$records:= ds.Parent.query (“essayWordCount >100 and parentReference_return #null) I have one monster query that is generated by concatenating strings to build the query part and Objects creating the parameters passed to the query. I have used code like you example in my parking lot function. > On Apr 27, 2020, at 2:08 PM, Peter Bozek <peter.bo...@gmail.com> wrote: > > > > On Mon, Apr 27, 2020 at 6:54 PM Eric Naujock via 4D_Tech > <4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>> wrote: > I am trying to preform an unusual query. I em effectively thing to find all > the records in a parent where the parent has children. Any suggestions other > than build a collection of records primary keys and use an “in” conditional. > Which feels dirty. > > > This this case I have a table “cases” with records and a Child table with > records. There is a one to many relationship from child to parent with a > return path of “childReference_return” I am looking for all the parents who > have children. There is more to the query but I am only looking at this > parent child element. > > Not sure if I understand it, but why not to select all children and map them > to parents? You would have something like this: > > $records:=ds.Children.all().parentReference > > where parentReference is name of relation from Children to Parents tables. > > HTH, > > Peter Bozek > > > > > > I have tried using something like. > > $records:=ds.Parents.query (“childReference_return.length>0”) > > But when I do this I get null back. > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > <http://lists.4d.com/archives.html> > Options: https://lists.4d.com/mailman/options/4d_tech > <https://lists.4d.com/mailman/options/4d_tech> > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > <mailto:4d_tech-unsubscr...@lists.4d.com> > ********************************************************************** > > ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************