question

Nareshy-8381 avatar image
0 Votes"
Nareshy-8381 asked Monalv-msft commented

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Monalv-msft avatar image
0 Votes"
Monalv-msft answered Monalv-msft commented

Hi @Nareshy-8381 ,

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.




df.png (132.1 KiB)
ffs.png (15.3 KiB)
dc.png (23.7 KiB)
cs.png (20.1 KiB)
agelessthan18.png (7.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Nareshy-8381 ,

May I know if you have anything to update?

Best regards,
Mona

0 Votes 0 ·