• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1616
  • Last Modified:

Populating a SSIS date variable from an Excel date.

Hello,

I'm getting an SSIS error ([Execute SQL Task] Error: An error occurred while assigning a value to variable "StartDate": "Unsupported data type on result set binding Start Date.".) when I try to read an Excel date into an SSIS variable.  The Excel cell is formatted as a date field as is the SSIS variable.  I can import the date (from Excel) into a SQL table with no problems but when I try to get it into the SSIS variable I get the error.

Any help would be appreciated!

Thanks in advance,
Rob
0
rkellow
Asked:
rkellow
2 Solutions
 
devsolnsCommented:
You could use SSIS and use convert(datetime, <FieldNAme>, 101).

Hope this helps.

--DS
0
 
rkellowAuthor Commented:
Hi DS,

Thanks for the reply.  I tried using the Convert funtion and it gave me another error (Undefined function).  I'm trying to use an "Execute SQL Task" to read from an Excel file and put the value in a SSIS variable.  I tried to put the Convert function call into the SQL statement of the Excute SQL task, I'm not sure why I'm getting the Undefined Function error but it is not working.  Any thoughts?

Thanks,
Rob
0
 
Anthony PerkinsCommented:
>>I'm not sure why I'm getting the Undefined Function error but it is not working.  Any thoughts?<<
If you are saying you get this error when you query an Excel spreadsheet, that would be understandable as you cannot use a T-SQL command with Excel.  Try importing the spreadsheet into a SQL Server staging table and you can then do you Execute SQL Task.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now