Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using GetDate() in SSIS with Derived transformation

Posted on 2007-03-29
4
Medium Priority
?
1,190 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 500 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

715 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