Solved

Expired_Flag Field in SSIS

Posted on 2011-02-14
4
776 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:lynanee
  • 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:lynanee
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:lynanee
ID: 34898867
Great!!! Thanks vdr1620
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Read about achieving the basic levels of HRIS security in the workplace.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now