Subject column does not belong to referenced table
Author markd_mms
I'm trying to select records where the CCEXPIRYDATE has past or is
within the next 30 days like so...

SELECT NAME, CCEXPIRYDATE,
CAST(CCEXPIRYDATE-CURRENT_DATE AS INTEGER) AS DAYSPAN
FROM SUBSCRIBERS
WHERE DAYSPAN <= 30

I get an error saying Column unknown DAYSPAN and that it doesn't
belong to a referenced table. But I figure I can't change it to WHERE
3 <= 30 because it sems as though it interprets 3 as a number rather
than a column.

Is there any way of getting around this?

TIA