ssis condition to verify the date column with the current date field "19670708" this should be the date format

Naresh y 146 Reputation points
2021-04-02T08:07:14.047+00:00

how to write the condition in condition split to check the person age below lessthan 18 years using the current date from source flat file

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,926 Reputation points
    2021-04-02T10:34:12.033+00:00

    Hi @Naresh y ,

    1.We can use Derived Column Transformation to convert the datatype of date and get age from date.

    2.Then use Conditional Split Transformation to get the age less than 18.

    Please refer to the following expressions and pictures:
    1.Expression for New Birthdate:
    (DT_DBDATE)(SUBSTRING(Birthdate,1,4) + "-" + SUBSTRING(Birthdate,5,2) + "-" + SUBSTRING(Birthdate,7,2))

    2.Expression for Age:
    DATEDIFF("yy",(DT_DBDATE)(SUBSTRING(Birthdate,1,4) + "-" + SUBSTRING(Birthdate,5,2) + "-" + SUBSTRING(Birthdate,7,2)),GETDATE())

    3.84013-df.png
    4.83985-ffs.png
    5.83986-dc.png
    6.83919-cs.png
    7.83920-agelessthan18.png

    Best regards,
    Mona


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.