Hi. I'm trying to write a select a query but get an error message - "Invalid Use of Null"
Table: tblBooks
FIELD NAME TYPE
BOOK_ID TEXT
CHK_OUT_DT DATE
RETURN_DT TEXT
Sample data
--------------------------------------------------
|BOOK_ID | CHK_OUT_DT | RETURN_DT
--------------------------------------------------
US432344 | 12/13/2003 | 12/15/2003 B.KERNIGHAN
PH322322 | 12/01/2003 |
US221277 | 12/10/2003 | 12/17/2003 M.RITCHIE
.
.
.
Question: Which BOOK_ID exceeded the limit of 5 days?
(I'm trying to just write one select query that will do this but I get the error)
SELECT BOOK_ID FROM tblBooks
WHERE ((RETURN_DT) Is Not Null) And
((CDATE(LEFT(RETURN_DT,10)) - CHK_OUT_DT) > 5);
Thanks in advance!
Jason
Table: tblBooks
FIELD NAME TYPE
BOOK_ID TEXT
CHK_OUT_DT DATE
RETURN_DT TEXT
Sample data
--------------------------------------------------
|BOOK_ID | CHK_OUT_DT | RETURN_DT
--------------------------------------------------
US432344 | 12/13/2003 | 12/15/2003 B.KERNIGHAN
PH322322 | 12/01/2003 |
US221277 | 12/10/2003 | 12/17/2003 M.RITCHIE
.
.
.
Question: Which BOOK_ID exceeded the limit of 5 days?
(I'm trying to just write one select query that will do this but I get the error)
SELECT BOOK_ID FROM tblBooks
WHERE ((RETURN_DT) Is Not Null) And
((CDATE(LEFT(RETURN_DT,10)) - CHK_OUT_DT) > 5);
Thanks in advance!
Jason