Hello David,
I do agree with the note from Brian, but simply changing the syntax of your
query should be enough to take advantage of an index on the target date field.
Here is how:
('1000005261' <= $\DATE$ + 86400 - 60*60*1 OR '1000005261' = $\NULL$) AND
'Status' < "Resolved"
In fact, you need to isolate the field from the math operations.
Best regards,
Jean-Louis Halleux
[email protected]
On 27 Nov 2013, at 19:33, Brian Goralczyk <[email protected]> wrote:
> **
> David,
>
> I am happy that it is working, but I would caution you against doing math on
> the field value. It put a lot of extra work on the database. You are much
> better doing the math against the variable and look for fields that fall
> within that range. Particularly if you have an index on that field. If you
> do, doing math against it invalidates the index.
>
> It might help to verbalize your qualification.
>
> I want records where today plus a day minus "field value" is greater than or
> equal to 3600 or the field value is null and status is less than resolved.
>
> I would recommend instead,
> I want records where status is less than resolved and "field value" is
> between midnight today and midnight tomorrow or value is null.
>
> I think you will find a substantial performance gain with the revision.
>
> HTH,
>
> Brian Goralczyk
>
>
> On Wed, Nov 27, 2013 at 12:07 PM, David Boylan <[email protected]> wrote:
> Thanks Brian.
>
> I ended up using this - ((($\DATE$ + 86400) - ( '1000005261') >= ((60 * 60)
> * 1)) OR ('1000005261' = $\NULL$ )) AND 'Status' < "Resolved"
>
> This worked.
>
> _______________________________________________________________________________
> UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
> "Where the Answers Are, and have been for 20 years"
>
> _ARSlist: "Where the Answers Are" and have been for 20 years_
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"