using parameters in SQL statements
I am trying to use a date parameter (start_date) in a function within an SQL
statement in a calc on the dataview..
(select etc where F_DATEINMONTHS(taxpoint_date,:start_date)=1)
I get the error 'Data type unknown'
If I replace the :start_date with an actual date it works.
statement in a calc on the dataview..
(select etc where F_DATEINMONTHS(taxpoint_date,:start_date)=1)
I get the error 'Data type unknown'
If I replace the :start_date with an actual date it works.
This discussion has been closed.
Comments
Which database and connectivity are you using? Are you able to get correct
parameter output when using a simple expression such as Where taxpoint_date
= :start_date ?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The sql expression in the previous post was inaccurate, sorry.
If I use the two expressions below in the sql editor on the dataview they
both work.
If I use them in calculated columns in the dataview, the second one fails
with error 'Dynamic SQL Error -804 Data type unknown' when I try to 'OK' the
expression in the dataview
1.
select entry_id from entry where
F_ageinmonths(entry_1.taxpoint_date,current_date)=1
2.
select entry_id from entry where
F_ageinmonths(entry_1.taxpoint_date,cast(:startdate as Date)=1
:startdate is a Date variable defined in the report tree.
The : syntax is currently only supported for manually edited SQL
(edit SQL as text). For a future release we could possibly enable this
syntax for a calculated field in the Query Designer.
I believe in order to get the SQL you are after you will currently need to
edit the SQL code manually as you mention below.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com