Please help me.
I have a select with "Not In" but it does not work. No idea what is wrong. See below:
SELECT var_rates.lnr
FROM var_rates
WHERE (((var_rates.start_period) Is Not Null) AND ((var_rates.end_period) Is Null))
GROUP BY var_rates.lnr;
lnr
486
487
530
531
540
Then I have
SELECT var_rates.lnr FROM var_rates
GROUP BY var_rates.lnr
HAVING (((Max(var_rates.end_period))>Now()-7 And (Max(var_rates.end_period))<Now()+7))
lnr
820
824
825
Notice please 820,824,825 are bit in previous result!
After I connect those two select to one with using "Not In"
SELECT var_rates.lnr FROM var_rates
WHERE
(
(
(var_rates.lnr) Not In
(
SELECT var_rates.lnr FROM var_rates WHERE
(
((var_rates.start_period) Is Not Null) And
((var_rates.end_period) Is Null)
)
GROUP BY var_rates.lnr;
)
)
) GROUP BY var_rates.lnr
HAVING (((Max(var_rates.end_period))>Now()-7 And (Max(var_rates.end_period))<Now()+7))
so I should have as a result
820,824,825 because they are in var_rates with mentioned condition and in the same time they are NOT IN mentioned Select result.
Hope you understand my point and you can give me any advice. thank you
I have a select with "Not In" but it does not work. No idea what is wrong. See below:
SELECT var_rates.lnr
FROM var_rates
WHERE (((var_rates.start_period) Is Not Null) AND ((var_rates.end_period) Is Null))
GROUP BY var_rates.lnr;
lnr
486
487
530
531
540
Then I have
SELECT var_rates.lnr FROM var_rates
GROUP BY var_rates.lnr
HAVING (((Max(var_rates.end_period))>Now()-7 And (Max(var_rates.end_period))<Now()+7))
lnr
820
824
825
Notice please 820,824,825 are bit in previous result!
After I connect those two select to one with using "Not In"
SELECT var_rates.lnr FROM var_rates
WHERE
(
(
(var_rates.lnr) Not In
(
SELECT var_rates.lnr FROM var_rates WHERE
(
((var_rates.start_period) Is Not Null) And
((var_rates.end_period) Is Null)
)
GROUP BY var_rates.lnr;
)
)
) GROUP BY var_rates.lnr
HAVING (((Max(var_rates.end_period))>Now()-7 And (Max(var_rates.end_period))<Now()+7))
so I should have as a result
820,824,825 because they are in var_rates with mentioned condition and in the same time they are NOT IN mentioned Select result.
Hope you understand my point and you can give me any advice. thank you