I hope you can help me with that two questions. I copied a bunch of code from an Accessfile into the MSSQL Server to create some Views. Until now everything has worked fine so far but now I stuck...
One Problem is related to the "IIF"-Command:
IIf([T024_ArtStamm]![C002] Like "A*",[dbo_T023_ArtPreise]![C006],[A PreisListe 01]![C013]) AS Verrechnungspreis
I changed it to:
IIf([Buran.dbo.T024_ArtStamm].[c002] like 'A%',
[Buran.dbo.T023_ArtPreise].[C006],
[Buran.dbo.A_PreisListe_01].[C013]) AS Verrechnungspreis
To me it looks correct. But the Server has some issues with that...
Msg 156, Level 15, State 1, Line 12
Incorrect syntax near the keyword 'like'.
I tried '=' as well but meanwhile I ran out of ideas...
The second issue is related to an inner join: Again in Access it works fine:
Select [...]
FROM ((((T024_ArtStamm INNER JOIN
dbo_t057 AS dbo_T057_ArtZusatz ON
(T024_ArtStamm.c106 = dbo_T057_ArtZusatz.c000) AND
(T024_ArtStamm.mesocomp = dbo_T057_ArtZusatz.mesocomp) AND
(T024_ArtStamm.mesoyear = dbo_T057_ArtZusatz.mesoyear)) INNER JOIN [--goes on for a while--]
I converted it so all the tables can be found...
Select [...]
--Line 54
FROM ((((Buran.dbo.T024_ArtStamm INNER JOIN
--/
CWLDATEN_91.dbo.t057 AS Buran.dbo.T057_ArtZusatz ON
(Buran.dbo.T024_ArtStamm.c106 = dbo.T057_ArtZusatz.c000) AND
(Buran.dbo.T024_ArtStamm.mesocomp = dbo.T057_ArtZusatz.mesocomp) AND
(Buran.dbo.T024_ArtStamm.mesoyear = dbo.T057_ArtZusatz.mesoyear)) INNER JOIN [--and it goes on--]
But the error is
Msg 102, Level 15, State 1, Line 54 Incorrect syntax near 'Buran'.
I checked all the Tables - they exist. I tried with Squirrel SQL instead of the SQL Server manager and get the same error...
Where am I wrong?