Solved

Expired_Flag Field in SSIS

Posted on 2011-02-14
4
784 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

749 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