Solved

Using GetDate() in SSIS with Derived transformation

Posted on 2007-03-29
4
1,163 Views
Last Modified: 2013-11-30
Guys:
I’m trying to add a new column using the Derived Column transformation; I need to accomplish the following but not having any luck:

Need to substract 1 ½ day from Current time.
This is what I have:

GETDATE() – 1.5

This is not working,  I know I have to use a cast operator but can’t figure out which one.
0
Comment
Question by:Oneill0003
[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
4 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 18819521

use

dateadd(h,-36,getdate())

ie 36 hours

the date day subtraction uages only allows for integer days...
0
 

Author Comment

by:Oneill0003
ID: 18819609
What about if i need to substract 20 minutes?

0
 
LVL 8

Accepted Solution

by:
drydenhogg earned 125 total points
ID: 18822110
dateadd(mi,-20,getdate())
0
 

Author Comment

by:Oneill0003
ID: 18822938
Thanks drydenhogg that worked great!


DATEADD("Minute",-20,GETDATE())
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Many to one in one row 2 40
SQL Instance service gone? 5 39
Access #Deleted data 20 43
Specify timing interval fro change data 2 57
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

730 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