Microsoft SQL Server 2008
--
Questions
--
Followers
Top Experts
An example value of the date in the sql database is 111222. (08/10/2011)
The JDE julian date is 6 digits. Â I can create a function in sql server to do this but the
dba doesnt want any functions in that particular db.
So I need to figure out how to do this in the IDE for SSIS. Â Im not sure if there is a place to write
a custom function in the IDE or if I have to use the built in functions to try and convert.
See attached screen.
Capture.JPG
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
All the other fields should go straight in with little transform. Â
Ive never used the script component before so im trying figure it out. Â Im assuming you have to use either the script component or derive columns not both in the same data flow.
So somehow i have to figure out how to convert a julian date back to a regular date.
The julian date is lets say 111222.
All that I have available to me in SSIS is dateadd, datediff, datepart, day, getdate, month and year functions. Â Most of which require a date field as a parameter.
If anyone has any ideas I appreciate. Â I am using two derived tasks to split the julian date
into  century = 1, year = 11, and day =222.
Thanks
1st Derived Column (OutputColumn as gldate, inputcolumn as Jdate)
(DT_STR,20,1252)(SUBSTRING
2nd Derived Column
DATEADD(D,SUBSTRING(@gldat
Let me know, if you have any issues..
p.s.i have used a case to check for century and the code is based on the sql here
 http://www.dbforums.com/microsoft-sql-server/1646454-sql-day-year-cyyddd-datetime-mm-dd-yyyy-conversion.html






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
See attached image. Â derived #1 was free of error.
thanks again.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
i just changed @gldate to gldate
so if you use substring it has to be cast I think.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
In Derived transformation 1 .. Add another column to derive the DayofYear - (DT_I4)(SUBSTRING(gldate,4
DATEADD("D",DayOfYear,(DT_
 DayofYear - (DT_I4)(SUBSTRING(jdate,4,3))

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Ive almost got it but there are a few errors about converting unicode to string.
Error      1      Validation error. Data Flow Task OLE DB Destination [454]: Column "col1" cannot convert between unicode and non-unicode string data types.       JDE_Export_EBMS.dtsx      0      0     Â
Thanks.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
You can add it b/w the derived column and the destination to see all your columns before loading them into the table ..
Also, change the column data type according to your destination column.. if its NVarchar convert it using (DT_WSTR,Length)(col1), if varchar use the above exp
http://sqlblog.com/blogs/andy_leonard/archive/2010/03/08/ssis-snack-grid-data-viewer.aspx
If you wan to run a Task (data flow task etc)..rt click on it and select Execute

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ie. Â pressing F5 doesnt do anything.
See attached image.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
you can actually follow the below link and run it from Visual studio
http://blogs.msdn.com/b/michen/archive/2007/03/15/ssis-debug-disabled.aspx
I had saved the .dtsx file out on the network and was editing it directly instead of opening the solution file. Â See attached screen.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Thanks again.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
you can the run the package as is ..and sql wll make the changes... Now, if the data type is not Date then we will need to change that in the Derived Transformation by replacing "-" with "/" and interchange the date format to DD/MM/YYYY
CREATE TABLE #D
(
D Date
)
INSERT INTO #D VALUES ('2011-03-03')
INSERT INTO #D VALUES ('02/02/2011')
SELECT * FROM #D
DROP TABLE #D
Thank you very much sir!






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Can someone help?
(DT_STR,20,1252)(SUBSTRING
Microsoft SQL Server 2008
--
Questions
--
Followers
Top Experts
Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.