I have a query that calculates incremental values from cumulative values (yes - I know I am doing it twice. Assuming I can fix my connection to excel issue - which is better? IIF or SWITCH?)
Code:
SELECT t1.*,
IIF(t1.TriangleOPIndex = 1, 0, t1.TriangleCumValue - Nz(t2.TriangleCumValue, 0) ) AS incremental_value1,
switch (
t1.TriangleOPIndex = 1, 0,
true, t1.TriangleCumValue - Nz(t2.TriangleCumValue, 0)
) AS incremental_value2
FROM ModelTriangles AS t1 LEFT JOIN ModelTriangles AS t2 ON t1.ID = t2.ID + 1;
It works with either IIF or SWITCH.
However, my excel can't see this query if I include IIF or SWITCH in the query. Those queries are not in the list of items it presents when I try to form a connection to the access db. If I delete the IIF or SWITCH statement, it sees it.
Is this me and my limited query knowledge? Excel? Access? Solar flares?