What about something like this.  (note the placement of the () with the
AND/OR)...

Justin

SELECT  Items.ItemID, Items.Name, Items.LastModified,
                Viewed.UserID, Viewed.LastViewedDate
FROM            Items LEFT OUTER JOIN Viewed 
                ON Items.ItemID = Viewed.ItemID
WHERE           (Viewed.UserID = 1  
                and Viewed.LastViewedDate < Items.LastModified)
                or Viewed.UserID is null
ORDER           BY Items.ItemID



> -----Original Message-----
> From: Steven Duff [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 12:00 AM
> To: CF-Talk
> Subject: SQL query driving me nuts
> 
> <SNIP>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to