Link to home
Start Free TrialLog in
Avatar of Oneill0003
Oneill0003

asked on

Using GetDate() in SSIS with Derived transformation

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.
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image


use

dateadd(h,-36,getdate())

ie 36 hours

the date day subtraction uages only allows for integer days...
Avatar of Oneill0003
Oneill0003

ASKER

What about if i need to substract 20 minutes?

ASKER CERTIFIED SOLUTION
Avatar of drydenhogg
drydenhogg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks drydenhogg that worked great!


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