locked
Error On Expression RRS feed

  • Question

  • Hi Please tell me where I am doing wrong

    TITLE: Microsoft Visual Studio
    ------------------------------

    Error at DFT Skapa felfil [DER Detaljrad Avtal [85]]: The data types "DT_WSTR" and "DT_DBDATE" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

    Error at DFT Skapa felfil [DER Detaljrad Avtal [85]]: Attempt to set the result type of binary operation "TRIM(POSTTYP) + "^;" + BORTTAG + "^;" + SYSTEM + "^;" + TRIM(LANSBOLAGSKOD) + "^;" + AVTALSNUMMER + "^;" + TRIM(STATUS) + "^;" + PRODUKTKOD + "^;" + STARTDATUM" failed with error code 0xC0047080.

    Error at DFT Skapa felfil [DER Detaljrad Avtal [85]]: Computing the expression "TRIM(POSTTYP) + "^;" +BORTTAG + "^;" + SYSTEM + "^;" + TRIM(LANSBOLAGSKOD) + "^;" + AVTALSNUMMER + "^;" + TRIM(STATUS) + "^;" + PRODUKTKOD + "^;" + STARTDATUM + "^;" + FORFALLODAG + "^;" + (DT_STR,20,1252)PREMIE + "^;" + AVTALSBESKRIVNING + "^;" + (DT_STR,20,1252)BETALNINGSTERMIN + "^;" + ANNULATIONSDATUM + "^;" + GALLERFROMDATUM + "^;" + @[User::gsInFilNamn] + "^;" + (DT_STR,20,1252)zRowID +"^;" + SUBSTRING((DT_STR,30,1252)zLoadTime,1,19) + "^;" + zFelBeskrivning" failed with error code 0xC0047084. The expression may have errors, such as divide by zero, that cannot be detected at parse time, or there may be an out-of-memory error.

    Error at DFT Skapa felfil [DER Detaljrad Avtal [85]]: The expression "TRIM(POSTTYP) + "^;" +BORTTAG + "^;" + SYSTEM + "^;" + TRIM(LANSBOLAGSKOD) + "^;" + AVTALSNUMMER + "^;" + TRIM(STATUS) + "^;" + PRODUKTKOD + "^;" + STARTDATUM + "^;" + FORFALLODAG + "^;" + (DT_STR,20,1252)PREMIE + "^;" + AVTALSBESKRIVNING + "^;" + (DT_STR,20,1252)BETALNINGSTERMIN + "^;" + ANNULATIONSDATUM + "^;" + GALLERFROMDATUM + "^;" + @[User::gsInFilNamn] + "^;" + (DT_STR,20,1252)zRowID +"^;" + SUBSTRING((DT_STR,30,1252)zLoadTime,1,19) + "^;" + zFelBeskrivning" on "output column "Detaljrad" (116)" is not valid.

    Error at DFT Skapa felfil [DER Detaljrad Avtal [85]]: Failed to set property "Expression" on "output column "Detaljrad" (116)".



    ------------------------------
    ADDITIONAL INFORMATION:

    Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    Sunday, September 29, 2013 3:26 AM

Answers

  • Hi,

    You are trying to concatenate string with date and you cannot do that without explicit cast of date to string. Try something like this:

    (DT_STR, 30, 1250 )@[User::Date] + @[User::String]

    HTH, Regards, Dean Savović

    • Proposed as answer by Harry Bal Thursday, October 3, 2013 7:37 PM
    • Marked as answer by Mike Yin Sunday, October 6, 2013 3:05 PM
    Sunday, September 29, 2013 10:05 AM