- Local time
- Yesterday, 22:07
- Joined
- Feb 19, 2002
- Messages
- 47,457
Did you try my original suggestion? You want to select rows where one of two conditions is true.
1. Between Start and End date
2. Cleared = False
This REQUIRES an OR operator.
Where SomeDate Between [StartDate] and [EndDate] OR ClearedFlg = False
Remember - if you didn't default the cleared flag to False, you may have null values and so you might have to deal with nulls.
If you write the expression this way - it REQUIRES parentheses to force Access to evaluate it correctly.
Where (SomeDate >= [StartDate] and SomeDate <= [EndDate]) OR (ClearedFlg = False OR ClearedFlg Is Null)
And Finally, if you need to be able to move the date range around so that it might be in the past, you have to worry about checks that were written AFTER the data range.
Where (SomeDate >= [StartDate] AND SomeDate <= [EndDate]) OR ((ClearedFlg = False OR ClearedFlg Is Null) AND SomeDate <= [EndDate])
1. Between Start and End date
2. Cleared = False
This REQUIRES an OR operator.
Where SomeDate Between [StartDate] and [EndDate] OR ClearedFlg = False
Remember - if you didn't default the cleared flag to False, you may have null values and so you might have to deal with nulls.
If you write the expression this way - it REQUIRES parentheses to force Access to evaluate it correctly.
Where (SomeDate >= [StartDate] and SomeDate <= [EndDate]) OR (ClearedFlg = False OR ClearedFlg Is Null)
And Finally, if you need to be able to move the date range around so that it might be in the past, you have to worry about checks that were written AFTER the data range.
Where (SomeDate >= [StartDate] AND SomeDate <= [EndDate]) OR ((ClearedFlg = False OR ClearedFlg Is Null) AND SomeDate <= [EndDate])