Hi,
I hope someone can help me:
The data I am working with is as follows:
Pers_ID Rate Amount Effective_Date Expiration_Date
------- ---- ------ -------------- ---------------
1 13.00 100.00 07/22/2003
1 16.00 200.00 09/15/2000 07/21/2003
1 19.00 300.00 08/05/1996 09/14/2000
The select I am currently running is:
SELECT Amount
FROM Ratetable
WHERE Pers_ID = <An Incoming Person ID>
AND Expiration_Date is null;
My problem is that the select statement will
always select the first row because of the where clause.
For example if today's date was 06/22/2003 I would want
the second row, because the effective date of 07/22/2003
is greater than 06/22/2003.
What I want is an effective date that is not greater than
today's date regardless of the expiration date being null.
I was wondering if there is a way of doing this without
using cursors. Thanks.
getjbb
I hope someone can help me:
The data I am working with is as follows:
Pers_ID Rate Amount Effective_Date Expiration_Date
------- ---- ------ -------------- ---------------
1 13.00 100.00 07/22/2003
1 16.00 200.00 09/15/2000 07/21/2003
1 19.00 300.00 08/05/1996 09/14/2000
The select I am currently running is:
SELECT Amount
FROM Ratetable
WHERE Pers_ID = <An Incoming Person ID>
AND Expiration_Date is null;
My problem is that the select statement will
always select the first row because of the where clause.
For example if today's date was 06/22/2003 I would want
the second row, because the effective date of 07/22/2003
is greater than 06/22/2003.
What I want is an effective date that is not greater than
today's date regardless of the expiration date being null.
I was wondering if there is a way of doing this without
using cursors. Thanks.
getjbb