Hi, Lots of things can go into the join clause....... and placing more criteria into the join clauses can often speed-up your queries (especially for large data sets) where the initial number of records can be reduced significantly.
That said however, the query optimizer is the ultimate decider and it just may place the criteria into the where clause. (I am referring to query plans ). I guess its just what you are used to.... my background is in database development, application development came a bit later.... >>> "Seona Bellamy" <[EMAIL PROTECTED]> 25/08/2008 9:34 am >>> Thanks for the suggestion, Scott. I must admit, I hadn't thought about putting the date restriction into a join clause. Another trick to add to my arsenal. :) Cheers, Seona. 2008/8/25 Scott Thornton <[EMAIL PROTECTED]>: > > Hi Seona, > > I like to use a LEFT OUTER JOIN for a query like this. It would look > something like > > SELECT u.emailaddress, u.firstname, u.surname, u.rec_id, > bde.bde_entrydate > FROM users u > INNER JOIN body_diaries bd > ON u.rec_id = bd.bdi_usr_id > left outer join JOIN body_diary_entries bde > ON bd.bdi_id = bde.bdi_id > where > bde.bdi_id is null > > which should return users that have body_diaries, but NO body_diary_entries. > you can add in the left outer join clause the date parameter for that day. eg > > left outer join JOIN body_diary_entries bde > ON bd.bdi_id = bde.bdi_id and > entry_date > #CreateODBCDate( todays_date )# --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---
