Date parameter passing as String
I am using the Excel Reporting in QC10. I want to be able to set up a parameter that is a date which gets passed through to the SQl query and generates my excel report. the problem is that the query errors stating it is unable to convert string to date.
My query is this:
<font class="small">Code:</font><hr /><pre> SELECT Count(Audit_log.AU_ACTION_ID) AS CountOfAU_ACTION_ID, Audit_Properties.AP_NEW_VALUE
FROM Audit_log INNER JOIN Audit_Properties ON Audit_log.AU_ACTION_ID = Audit_Properties.AP_ACTION_ID
GROUP BY Audit_Properties.AP_NEW_VALUE, Audit_log.AU_TIME
HAVING ((Audit_Properties.AP_NEW_VALUE)='rejected') AND ((Audit_log.AU_TIME) >'@StartTime') </pre><hr />
My Parameter is StartTime and it = 2011-01-01.
The query works fine without the parameter but is much less usable
Re: Date parameter passing as String
1. Parameter should be enclosed by @
2. The error is right, I think. [img]/images/graemlins/wink.gif[/img]
You are passing a string but need to pass a date.
Try something like
<font class="small">Code:</font><hr /><pre>SELECT BUG.BG_DETECTION_DATE FROM BUG WHERE BUG.BG_DETECTION_DATE like to_date('2011-01-01','yyyy-mm-dd') </pre><hr />