YJG YJG -4 years ago 125
SQL Question

SSIS take -1 hour from current date and time

I am new at SSIS currently trying to do is to get 1 hr less from current time

I am using

(DT_DATE) GETDATE()


My Output is:

27/02/2017 4:24:09 PM


My Expected output is:

27/02/2017 3:24:09 PM


Can please someone help me on this. Thanks

Answer Source

You have to use the following expression

DATEADD("Hh",-1, GETDATE())

Read more about DATEADD In this MSDN article

Side Note: GETDATE() is a function that returns the current date and doesn't need to be parsed using (DT_DATE) GETDATE()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download