Solved

Using GetDate() in SSIS with Derived transformation

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

705 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

18 Experts available now in Live!

Get 1:1 Help Now