Solved

Expired_Flag Field in SSIS

Posted on 2011-02-14
4
787 Views
Last Modified: 2012-05-11
Please how do I get expired_flag to show either 0 for current or 1 for expired rows? I am migrating data from a table that has Position_Start_Date and Position_End_Date which I mapped to my new fields called Effective_Date and Expired_Date respectively in the destination table. I also do have a field on my destination table called Expired_Flag. I am having a hard time getting this field to either show 0 if the record is expired or 1 if not. How do I make use of the fields position_start_date and position_end_date to cause the expired_flag to respond accordingly?

Thanks for helping!
0
Comment
Question by:Lyn Udy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:vdr1620
ID: 34898307
you can load the Expired_flag field using SQL or Derived column in SSIS.. i am not sure if i understand your criteria correctly to determine if its a 0 or 1. It would be good if you can explain the formula here..

Are you planning on an incremental load or is it one time load or Daily load ??
0
 

Author Comment

by:Lyn Udy
ID: 34898432
It's a one time load.

And I'm also trying to use derived column in SSIS to get the value. I want the field to show a value of 1 if the position_end_date is a date in the past (expired) or 0 if it's a date in the future or current date (current)
0
 
LVL 16

Accepted Solution

by:
vdr1620 earned 500 total points
ID: 34898614
Ok..That should be simple to do.. All you have to do is compare the date in that Column with getDate() function

you can use the below exp:

position_end_date <= GetDate() ? 1 : 0

Make sure that the Data Types Match..let me know if you need more help
0
 

Author Comment

by:Lyn Udy
ID: 34898867
Great!!! Thanks vdr1620
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

705 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