Subject | Re: column does not belong to referenced table |
---|---|
Author | Adam |
Post date | 2005-10-27T04:37:51Z |
--- In firebird-support@yahoogroups.com, "markd_mms" <spam@m...>
wrote:
SELECT NAME, CCEXPIRYDATE,
CAST(CCEXPIRYDATE-CURRENT_DATE AS INTEGER) AS DAYSPAN
FROM SUBSCRIBERS
WHERE CCEXPIRYDATE <= (CURRENT_DATE + 30)
Adam
wrote:
>WHERE
> 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
> 3 <= 30 because it sems as though it interprets 3 as a number ratherWhy not this:
> than a column.
>
> Is there any way of getting around this?
>
SELECT NAME, CCEXPIRYDATE,
CAST(CCEXPIRYDATE-CURRENT_DATE AS INTEGER) AS DAYSPAN
FROM SUBSCRIBERS
WHERE CCEXPIRYDATE <= (CURRENT_DATE + 30)
Adam