Query Oddity

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Sep 15 13:03:43 CDT 2003


on 9/15/03 12:29, Geoff Canyon at gcanyon at inspiredlogic.com wrote:

> I'm sure this is a newby question, so apologies in advance:
> 
> Why would the first query below return more results than the second
> query? The first has an added restricting clause, so it should, if
> anything, return fewer rows. But the result I see is that it returns
> more rows, seemingly ignoring some of the earlier clauses:
> 
> SELECT Recurrences.ScheduledStartDateTime,
> Recurrences.ScheduledEndDateTime, Events.Subject, Recurrences.RecID
> FROM Events,Recurrences
> WHERE ((Recurrences.ScheduledEndDateTime >= '7/27/2003' AND
> Recurrences.ScheduledStartDateTime <= '9/6/2003 23:59:59') AND
> Events.Duration >= 86400) AND Events.EventType <> 'ToDo'
> ORDER BY Recurrences.ScheduledStartDateTime
> 
> SELECT Recurrences.ScheduledStartDateTime,
> Recurrences.ScheduledEndDateTime, Events.Subject, Recurrences.RecID
> FROM Events,Recurrences
> WHERE ((Recurrences.ScheduledEndDateTime >= '7/27/2003' AND
> Recurrences.ScheduledStartDateTime <= '9/6/2003 23:59:59') AND
> Events.Duration >= 86400) ORDER BY Recurrences.ScheduledStartDateTime

Hi Geoff,

Please try group fields as next:

SELECT  Recurrences.ScheduledStartDateTime,
        Recurrences.ScheduledEndDateTime,
        Events.Subject,
        Recurrences.RecID
FROM 
        Events,Recurrences
WHERE 
        (Recurrences.ScheduledEndDateTime >= '7/27/2003' AND
        Recurrences.ScheduledStartDateTime <= '9/6/2003 23:59:59')
    AND  
        (Events.Duration >= 86400 AND Events.EventType <> 'ToDo')
ORDER BY 
        Recurrences.ScheduledStartDateTime


Valentina 1.x has glitch that you need group fields of the same table
together.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list