Hi,am using an sql query in my expression where i need to fetch the data based on the date. For example this is the query am using in varibale. select * from employee where m_dtadddate = "+ @[System::StartTime] +"' AND m_eid='"+@[User::eid]+"'.
When i evaluate this expression it is showing error like Datatypes DT_WSTR and DT_Date are incompatable for binary operator + how to avoid this error
asked May 25, 2012 at 07:06 AM in Default
Since it is the error at evaluation time, the root cause is that the Expression is of data type DT____WSTR, whereas the @[System::StartTime] is of data type DT___Date. To rectify this, you need to explicitly convert the data type of @[System::StartTime] to DT_WSTR. The simplest way could be
But this could lead to date conversion issues. Based upon your source/destination, you may need to format the date string accordingly by using date-time functions etc..Moreover, Thomas Rushton's suggestion is absolutely correct. You could be prompted a run time error (Not at the expression evaluation time) for the missing single quote. So please modify the expression as advised.
It looks to me as though you're missing a '
Shouldn't that be:
answered May 25, 2012 at 10:19 AM