Page 1 of 1

Regarding how to pass parameter of type datetime

Posted: Wed Feb 23, 2011 2:12 am
by maa
Hi

I want to pass parameter of type datetime to .mrt file.

I am using this query inside .mrt file

SELECT *
FROM TableName WHERE column = {Variable1}

0r


SELECT *
FROM TableName WHERE column between {Variable1} and {Variable2}

I am using this code in c# to initialize varables

DateTime dTime1 = new DateTime(2010, 01, 01);

report.compile();

//report.Dictionary.Variables["Variable1"].ValueObject = dTime1;

report["Variable1"] = dTime1;


The above method is working fine when I pass parameter of type string.

Please help me,this is very important aspect for us to continue using stimulsoft.

Thanks in advance.


Regarding how to pass parameter of type datetime

Posted: Wed Feb 23, 2011 3:09 am
by Alex K.
Hello,

When you use the DateTime type in the query with the Between construction, the date should be in the 'YYYYMMDD' format. Otherwise, you need to write a converter that will convert the date to your desired format.

Thank you.