March 14, 2008 at 12:53 pm
I get an ADO error message when I parse a standard SQL statement in my DTS package that is importing data to a table. Are case statements allowed in the dts query when importing data from an excel spreadsheet?
March 14, 2008 at 1:02 pm
Can you post the SQL statement that is failing?
-- You can't be late until you show up.
March 14, 2008 at 1:04 pm
SELECT '999' + RIGHT([Temporay ID], 5) AS ID, NULL
AS [Actual End Date], 'Terminated' AS status, [Actual End Date]
+ 1 AS Start_date, case when [Actual End Date] is NULL then [Proposed end date] else [Actual End Date] END as ACT_TERM
FROM ['Temporary Employees$']
WHERE
([Actual End Date] IS NOT NULL)
March 14, 2008 at 1:33 pm
You've got quotes inside your name brackets:
['Temp..']
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 17, 2008 at 11:20 am
Removing the single quotes dod nit make a diference.
March 17, 2008 at 11:27 am
As far as I know case functions are allowed in embedded dts queries. What is the error that you are receiving?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 17, 2008 at 12:13 pm
Does [ACTUAL END DATE] exist in the spreadsheet? It looks as if you are creating it in the select statement "NULL as [ACTUAL END DATE] " and trying to reference in the case statement at the same time.
You are also referencing it in your where clause as "where [ACTUAL END DATE] is not null" while setting it to null in the select.
March 18, 2008 at 6:37 am
If [ACTUAL END DATE] is an expression, I don't know that you could use an expression as part of a concatenation.. im a little confused by:
NULL as [ACTUAL END DATE]
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply