-
August 26th, 2021, 11:41 AM
#1
Intersecting number ranges
I am comparing a user input parameter begin and end number to a begin and end number stored as separate values in a database table for the purpose of selecting records. Also, if a dbend number is zero, it needs to be included. Currently, this is done in an inefficient way and am hoping someone can help optimize.
In the select expert is the following formula:
dbend >= 19010101 and dbstart >= paramstart and dbend <= paramend or
dbend >= 19010101 and dbstart <= paramstart and dbend <= paramend and dbend >=paramstart or
dbend >= 19010101 and dbstart <= paramstart and dbend >= paramend or
dbend >= 19010101 and dbstart >= paramstart and dbstart <= paramend and dbend >= paramend or
dbstart >= paramstart and dbstart <= paramend and dbend = 0 or
dbstart < paramstart and dbend = 0
Any help is greatly appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|