R
Reiner Harmgardt
Hi NG
i got the following code running perfect under Access97 full version.
if i let it run under Access97 runtime version i receive the error message
mentioned above at the line Mid([Objekt],9) & "" "" & [Kostenart].
SQL = ""
SQL = SQL & " INSERT INTO [" & xTab1 & "] "
SQL = SQL & " ( Contract, [Key SAP], [Key SAP Original],
CY, CM, CHF )"
SQL = SQL & " SELECT "
SQL = SQL & " A.Projektdefinition AS Contract, "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart] AS
[Key SAP], "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart] AS
[Key SAP Original], "
SQL = SQL & " Year([Buch#dat#]) AS CY, "
SQL = SQL & " Month([Buch#dat#]) AS CM, "
SQL = SQL & " Sum(A.[Wert/KWähr]) AS CHF"
SQL = SQL & " FROM [EP Import EXCEL] AS A"
SQL = SQL & " WHERE "
SQL = SQL & " (((A.KWähr) = ""CHF""))"
SQL = SQL & " GROUP BY "
SQL = SQL & " A.Projektdefinition, "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart], "
SQL = SQL & " Year([Buch#dat#]), "
SQL = SQL & " Month([Buch#dat#])"
SQL = SQL & " HAVING "
SQL = SQL & " (((Sum(A.[Wert/KWähr]))>=0.01 "
SQL = SQL & " OR (Sum(A.[Wert/KWähr]))<=-0.01));"
DoCmd.RunSQL SQL
i tried to use with Left([Objekt],9)... but with the same result.
can anyone tell the me where the problem is to be found?
Thanks a lot
Reiner
i got the following code running perfect under Access97 full version.
if i let it run under Access97 runtime version i receive the error message
mentioned above at the line Mid([Objekt],9) & "" "" & [Kostenart].
SQL = ""
SQL = SQL & " INSERT INTO [" & xTab1 & "] "
SQL = SQL & " ( Contract, [Key SAP], [Key SAP Original],
CY, CM, CHF )"
SQL = SQL & " SELECT "
SQL = SQL & " A.Projektdefinition AS Contract, "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart] AS
[Key SAP], "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart] AS
[Key SAP Original], "
SQL = SQL & " Year([Buch#dat#]) AS CY, "
SQL = SQL & " Month([Buch#dat#]) AS CM, "
SQL = SQL & " Sum(A.[Wert/KWähr]) AS CHF"
SQL = SQL & " FROM [EP Import EXCEL] AS A"
SQL = SQL & " WHERE "
SQL = SQL & " (((A.KWähr) = ""CHF""))"
SQL = SQL & " GROUP BY "
SQL = SQL & " A.Projektdefinition, "
SQL = SQL & " Mid([Objekt],9) & "" "" & [Kostenart], "
SQL = SQL & " Year([Buch#dat#]), "
SQL = SQL & " Month([Buch#dat#])"
SQL = SQL & " HAVING "
SQL = SQL & " (((Sum(A.[Wert/KWähr]))>=0.01 "
SQL = SQL & " OR (Sum(A.[Wert/KWähr]))<=-0.01));"
DoCmd.RunSQL SQL
i tried to use with Left([Objekt],9)... but with the same result.
can anyone tell the me where the problem is to be found?
Thanks a lot
Reiner