CROSS JOIN???

Jan 7, 2011 at 3:56 PM

This query...

            return (from hr180 in context.hr180
                    from pr164 in context.pr164
                    from pr154 in context.pr154
                    where
                        pr154.cid164 == pr164.cid && pr154.cid180 == hr180.cid && pr164.lactive && pr154.lactive &&
                        hr180.cid == uId
                    select new CsiPlusLeaveData
                        {
                            clastName = hr180.clastname,
                            cfirstname = hr180.cfirstname,
                            cmi = hr180.cmi,
                            cid = pr154.cid,
                            cid180 = pr154.cid180,
                            leavedesc = pr164.cleavedesc,
                            caccumsched = pr164.caccumsched,
                            accumrate = pr154.yaccumrate,
                            chrsordays = pr164.chrsordays,
                            leavecode = pr164.cleavecode
                        }).ToList();

...generated this query...

__Param__0__ = [000002]
SELECT t0.cfirstname, t0.clastname, t0.cmi, t1.caccumsched, t1.chrsordays, t1.cleavecode, t1.cleavedesc, t2.cid AS cid2, t2.cid180, t2.yaccumrate ;
FROM hr180 AS t0 ;
CROSS JOIN pr164 AS t1 ;
INNER JOIN pr154 AS t2 ;
  ON ((t2.cid164 = t0.cid) AND (t2.cid180 = t0.cid)) ;
WHERE ((t1.lactive AND t2.lactive) AND (t0.cid = __Param__0__))

...which isn't valid in VFP.

Coordinator
Jan 9, 2011 at 11:41 PM

I posted a fix for the cross join syntax.