main logo
Subject: another SQL problem
Author: Robert Brenstein
Posted: 2002/03/27 06:53:46
 
View Entire Thread
New Search


>SELECT pEmployeeId, pEmployeeLastname, pEmployeeFirstname,
>pEmployeeIsResearchLeaderFlag, pEmployeeFormerLastName, xPositionBeginDate
>FROM info_people, xdata_functions
>WHERE pEmployeeWebHideFlag = 0
>and xPositionBeginDate < [runDate]
>and xPositionEndDate > [runDate]
>and pEmployeeId = xPositionEmployeeRef
>ORDER by pEmployeeLastname, pEmployeeFirstname, xPositionBeginDate
>
>The [runDate] is replaced by the actual execution date.
>
>For whatever reason, this picks up entries where
> xFunctionBeginDate > [runDate] !?
>
>This time I do have all items from ORDER in SELECT.
>
>If I remove the first condition (pEmployeeWebHideFlag = 0), the
>results are as expected. Unfortunately, I do need this condition to
>exclude some people.
>

Ruslan, I should have mentioned that above does not use date fields.
I store dates as longs.

Another curiosity with the above. Adding another condition

and xPositionPriority = 0

finds even more entries rather than cutting out some. I think it
picks up all entries with xPositionPriority = 0 ignoring the date
restrictions altogether. There are too many entries to verify that
claim but using xPositionPriority = 1 seems to confirm that: I have
records with date conditions not met.

Robert
 
©2002 Robert Brenstein
<-- Prior Message New Search Next Message -->