Solved

SSIS Expression converted from SQL

Posted on 2013-06-28
2
603 Views
Last Modified: 2016-02-11
Hi I am very new to SSIS and I have a derived column that I want to use an expression to set the date,  I have the following SQL statement,  how do I convert to SSIS

(CAST(CONVERT(CHAR(8), getdate(), 112) AS DATEtime) ) -88
0
Comment
Question by:knamc
2 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 39286231
dateadd(day,-88,dateadd(day, datediff(day,0, getdate() ), 0))

SSIS dateadd
http://msdn.microsoft.com/en-us/library/ms141719.aspx
SSIS datediff
http://msdn.microsoft.com/en-us/library/ms139927.aspx

try to avoid conversion to varchar if you can, it is slower than using date functions
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 39289148
(DT_WSTR,4)YEAR(GETDATE()) + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2) +  RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2)
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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

943 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

10 Experts available now in Live!

Get 1:1 Help Now