Solved

SSIS Expression converted from SQL

Posted on 2013-06-28
2
596 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

SQL Server  2012 Release with lots of Enhancements in Database Engine functions, SSIS, SSRS and some of new services like Data Quality Server and Master Data Service. Of particular interest, and the focus of this Article is SSIS. So, time to elab…
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

19 Experts available now in Live!

Get 1:1 Help Now