Unfortunately, as a LeftJoin I don't believe I can use a where clause and get the same results; criteria in the where clause would filter out rows.
I also tried to add a Where clause to the LeftJoin, e.g. reportQuery.LeftJoin(visitQuery).On(...).Where(...) but ES silently ignored the Where clause.
However, I just managed to implement a workaround for now by fixing the syntax with quotes:
reportQuery.LeftJoin(visitQuery).On( reportQuery.PatientId == visitQuery.PatientId & visitQuery.VisitDate >= "'" + startDate.ToString() + "'" & visitQuery.VisitDate <= "'" + endDate.ToString() + "'");
I'm really hoping the next maintenance release addresses this.
Thanks,
Matt