?
Solved

How to validate the date in SSIS

Posted on 2010-03-23
2
Medium Priority
?
3,986 Views
Last Modified: 2013-11-30
Hello experts,

I am wondering in SSIS 2005, how we can check if the value of the date is valid or not.

I tried to use
isdate(mycol) =0? null : mycol
I used this in the divertcolumn box in expression, but id didn't work

I want something equivelant to this
0
Comment
Question by:alcsoft
  • 2
2 Comments
 
LVL 30

Accepted Solution

by:
Reza Rad earned 1000 total points
ID: 28380952
(Date_To_Check == "00/00/00" || (DT_Date)Date_To_Check < (DT_DATE)"1753-1-1") ? NULL(DT_DATE) : (DT_Date)Date_To_Check

reference:
http://wiki.sqlis.com/default.aspx/SQLISWiki/ExpressionDateFunctions.html

0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 28381504
another solution is that :
create a script component task , and inside the script check the date, and fill another column which contains validity of date.

note that there is no builtin function for checking IS a date valid in SSIS yet.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

594 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question