Hi,
For a SQL query I have 3 dropdown controls that collect 3 variables.
activo1 -> type "C"
activo2 -> type "C"
fecha_ini -> type "N"
And then on the "Onclickevent" I run the following xbasic code:
function newChartData as c (e as p)
DIM ARGS AS SQL::ARGUMENTS
Args.add("QueActivo1",e.datasubmitted.activo1)
Args.add("QueActivo2",e.datasubmitted.activo2)
Args.add("QueFecha",e.datasubmitted.fecha_ini)
sql = <<%txt%
SELECT convert(varchar, SPH_DATE, 104) AS SPH_DATE_F,
SUM(columna_1) OVER (ORDER BY SPH_date) AS 'Acumulado1',
SUM(columna_2) OVER (ORDER BY SPH_date) AS 'Acumulado2'
FROM Retornos_PCT1
WHERE sph_date>DATEADD(day, :QueFecha , GETDATE())
ORDER BY SPH_DATE
%txt%
And after this I get an error stating that the QueFecha argument is a "C" type and it should be a "N" type.
And If I debug this code, I get the following:
<SQLArguments>� <SQLArgument>� <Name>queactivo1</Name>� <Data Type="C">XAUEUR</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>� <SQLArgument>� <Name>queactivo2</Name>� <Data Type="C">XAGEUR</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>� <SQLArgument>� <Name>quefecha</Name>� <Data Type="C">-30</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>�</SQLArguments>�
My question is: How can I make sure that the argument QueFecha remains a numeric type?
Many thanks,
Javier
For a SQL query I have 3 dropdown controls that collect 3 variables.
activo1 -> type "C"
activo2 -> type "C"
fecha_ini -> type "N"
And then on the "Onclickevent" I run the following xbasic code:
function newChartData as c (e as p)
DIM ARGS AS SQL::ARGUMENTS
Args.add("QueActivo1",e.datasubmitted.activo1)
Args.add("QueActivo2",e.datasubmitted.activo2)
Args.add("QueFecha",e.datasubmitted.fecha_ini)
sql = <<%txt%
SELECT convert(varchar, SPH_DATE, 104) AS SPH_DATE_F,
SUM(columna_1) OVER (ORDER BY SPH_date) AS 'Acumulado1',
SUM(columna_2) OVER (ORDER BY SPH_date) AS 'Acumulado2'
FROM Retornos_PCT1
WHERE sph_date>DATEADD(day, :QueFecha , GETDATE())
ORDER BY SPH_DATE
%txt%
And after this I get an error stating that the QueFecha argument is a "C" type and it should be a "N" type.
And If I debug this code, I get the following:
<SQLArguments>� <SQLArgument>� <Name>queactivo1</Name>� <Data Type="C">XAUEUR</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>� <SQLArgument>� <Name>queactivo2</Name>� <Data Type="C">XAGEUR</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>� <SQLArgument>� <Name>quefecha</Name>� <Data Type="C">-30</Data>� <IsNull Type="L">0</IsNull>� <Usage>Input</Usage>� </SQLArgument>�</SQLArguments>�
My question is: How can I make sure that the argument QueFecha remains a numeric type?
Many thanks,
Javier
Comment