How to use a DateTime Variable as Parameter in SSIS MySQL Source Component

Discussion of issues, suggestions and bugs of Devart SSIS Data Flow Components, our product line for building SSIS-based ETL solutions, performing data access to popular cloud applications and databases.
Post Reply
jpsignups
Posts: 3
Joined: Tue 29 Oct 2019 16:54

How to use a DateTime Variable as Parameter in SSIS MySQL Source Component

Post by jpsignups » Fri 15 Jan 2021 03:01

I have a variable set in my SSIS package called LastModified. I would like to use this in a SELECT in the Devart MySql Source component. Using the expression editor, I set the SELECT to:

SELECT * FROM Invoices WHERE LastModified > '<@user::LastModified>';

I have tried making the variable a DateTime and a String without any success. It seems as though it only passes the time portion of the variable through to the MySQL Server.

IF I hardcode the date it works as in

SELECT * FROM Invoices WHERE LastModified > '2021-01-01';

So, the question is, how do I go about using a DateTime variable and passing it into the Devart MySql Source component correctly?

Thanks,
Juan

DmitryGm
Devart Team
Posts: 152
Joined: Fri 11 Dec 2020 10:27

Re: How to use a DateTime Variable as Parameter in SSIS MySQL Source Component

Post by DmitryGm » Fri 22 Jan 2021 08:11

jpsignups wrote: Fri 15 Jan 2021 03:01 I have tried making the variable a DateTime and a String without any success.
There is some issue with variables of type DateTime in the Data Flow Component. We are investigating it. We will notify you as soon as we have a fix.

As for now, I recommend using a String variable with values in the following format:
YYYY-MM-DD (Date only)
YYYY-MM-DD hh:mm (Date and Time)

It should work.

Post Reply