I'm having a difficult time figuring out exactly how to perform the following query using the generated code. It involves using MAX() on a date field, which I'm not sure is even allowed. Any help would be much appreciated:
select count(*) from LogTable where userID = 1193791
and LogDate > (select MAX(VisitDate) from Visit where userID = 1193791)