[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Expired_Flag Field in SSIS

Posted on 2011-02-14
4
Medium Priority
?
795 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
  • 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

873 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