Subject | Re: Can a SQL parameter have a string value passed to a date field? |
---|---|
Author | Adam |
Post date | 2005-01-08T21:05:19Z |
Do you mean that for param1 , you want to pass in the number of years?
you could change that line to
WHERE (P.BIRTH_DATE <= CURRENT_DATE - (:Param1 * 365)
but
don't forget the leap years. I would get your client spplication to
pass in the number of days to be safe.
--- In firebird-support@yahoogroups.com, "M Tuttle \(KS\)"
<miket@s...> wrote:
you could change that line to
WHERE (P.BIRTH_DATE <= CURRENT_DATE - (:Param1 * 365)
but
don't forget the leap years. I would get your client spplication to
pass in the number of days to be safe.
--- In firebird-support@yahoogroups.com, "M Tuttle \(KS\)"
<miket@s...> wrote:
> Greeting All,value for
>
> Looking at the SQL below, is there any way to pass the following
> Param1: CURRENT_DATE - (65 * 365)value.
>
> SELECT DISTINCT P.*
> FROM PERSON P
> WHERE (P.BIRTH_DATE <= :Param1
> AND P.LIST_DATE between :Param2 and :Param3)
>
> Param1 cannot be hardcoded in this SQL as it is a user defined
>
> Param2 and Param3 will have a regular date value entered.
>
> Any tips appreciated.
>
> Michael Tuttle
> Software Technologies, Inc.
> Topeka, KS