Solved

Using GetDate() in SSIS with Derived transformation

Posted on 2007-03-29
4
1,157 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
  • 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MSSQL: Replace text (typo) 7 31
Sql Join Problem 2 27
Replace Dates in query 14 15
SQL Server Update Query Streamline 4 10
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

910 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

22 Experts available now in Live!

Get 1:1 Help Now