Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Expressions


SSIS Expressions

Poll
How to write an DATEDIFF @ DATEDIFF function inside a Derived column of an SSIS Package. Im trying to have this both this functions as an expression in a derived column."DATEDIFF(MONTH,con.commencement_date,@EndDate) AS 'Months In Force'" - "commencement_date BETWEEN DATEADD(MONTH,-6,GETDATE()) A

100% - 4 votes How to write an DATEDIFF @ DATEDIFF function inside a Derived column of an SSIS Package. Im trying to have this both this functions as an expression in a derived column."DATEDIFF(MONTH,con.commencement_date,@EndDate) AS 'Months In Force'" - "commencement_date BETWEEN DATEADD(MONTH,-6,GETDATE()) A
100% 4 votes
Member votes: 4, Guest votes: 0. You don't have permission to vote in this poll
Author
Message
nthetengm
nthetengm
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 67
How to write a DATEDIFF function inside a Derived column of an SSIS Package. Im trying to have theses functions as an expression in a derived column."DATEDIFF(MONTH,con.commencement_date,@EndDate) AS 'Months In Force'" - "commencement_date BETWEEN DATEADD(MONTH,-6,GETDATE()) AND GETDATE()"
Todasdasdfd asfasf
Todasdasdfd asfasf
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 109
When you post a question, especially one where you can't get something to work the way you expect, please post complete information. In this case, post the expression you used, the results you obtained (the error text) and the desired result. Without that, we can only guess.

Here's my guess: You haven't read BOL on the SSIS DATEDIFF function to know that it takes a quoted literal instead of a token as the time interval, unlike T-SQL. Most of the SSIS functions that look like T-SQL functions don't operate the same, you'll have to read up on how they're different. Use "month" instead of month.

Todd McDermid - SQL Server MVP, MCSD.Net, MCTS (SQL08BI)
Find great SSIS extensions - most are open source - at SSIS Community Tasks and Components
Are you doing Data Warehouse ETL with SSIS? Don't use the slow SCD Wizard, use the Kimball Method SCD component instead.
veerendramsbi
veerendramsbi
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 1
i want to real time scenarios
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16447 Visits: 13202
veerendramsbi (1/7/2011)
i want to real time scenarios


Don't we all?



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
xequence
xequence
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 10
So, there is no solution to this post? Why does it exist in google when i try to find an answer then? Nobody wants to read how to post a correct question. Just makes you sound like a real douche.
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16564 Visits: 17014
I personally hacked into google's server to add this post to their search engine just to irritate you. If you actually read the post you would realize that the answer in looking at the BOL entry for SSIS datediff function. Maybe you should try the same instead jumping onto a forum and shouting insults.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
xequence
xequence
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 10
DATEADD("month",4,(DT_DATE)[column])
Kum@R marlapati
Kum@R marlapati
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 61
You can add that column names as a new columns in your derived column transformation and in expressions you have to use date functions which are available in the transforamtion.:-)

Thanks

kumar
kiran.vaichalkar
kiran.vaichalkar
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 127
@KUMAR/All,

can you specify the string we can use as the EXPRESSION under the derived column transformation.

I've also attached a screenshot in the URL.

Please see how it violates the existing DATEDIFF() function in SSMS.

IS that SSIS dont understand DATEDIFF() ?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search