Losing Faith!
Posted: Wed 31 May 2017 03:29
Howdy All!
I am trying to replace 15+ year old TxQuery with TVirtualQuery and I keep hitting a brick wall.
The first attempt SQL statement I tried against a memory table returned the the following results (TxQuery version works):
Is TVirtualQuery a beta beta component @ this point?
Error: Error: Access violation at address 02B9B1A2 in module 'TheVirtualTicketer.exe'. Read of address FFFFFFFC
SQL: SELECT PeriodYear,AccountNumber,AccountDescription,
SUM( CASE PeriodMonth
WHEN 1 THEN Amount
ELSE 0.0
END
) AS PeriodAmount01,
SUM( CASE PeriodMonth
WHEN 2 THEN Amount
ELSE 0.0
END
) AS PeriodAmount02,
SUM( CASE PeriodMonth
WHEN 3 THEN Amount
ELSE 0.0
END
) AS PeriodAmount03,
SUM( CASE PeriodMonth
WHEN 4 THEN Amount
ELSE 0.0
END
) AS PeriodAmount04,
SUM( CASE PeriodMonth
WHEN 5 THEN Amount
ELSE 0.0
END
) AS PeriodAmount05,
SUM( CASE PeriodMonth
WHEN 6 THEN Amount
ELSE 0.0
END
) AS PeriodAmount06,
SUM( CASE PeriodMonth
WHEN 7 THEN Amount
ELSE 0.0
END
) AS PeriodAmount07,
SUM( CASE PeriodMonth
WHEN 8 THEN Amount
ELSE 0.0
END
) AS PeriodAmount08,
SUM( CASE PeriodMonth
WHEN 9 THEN Amount
ELSE 0.0
END
) AS PeriodAmount09,
SUM( CASE PeriodMonth
WHEN 10 THEN Amount
ELSE 0.0
END
) AS PeriodAmount10,
SUM( CASE PeriodMonth
WHEN 11 THEN Amount
ELSE 0.0
END
) AS PeriodAmount11,
SUM( CASE PeriodMonth
WHEN 12 THEN Amount
ELSE 0.0
END
) AS PeriodAmount12,
SUM(Amount) AS TotalAmount
FROM ReportRevenuesLedger
GROUP BY PeriodYear,AccountNumber,AccountDescription
ORDER BY PeriodYear,AccountNumber,AccountDescription
SQL: SELECT PeriodYear,AccountNumber,AccountDescription,
SUM( CASE PeriodMonth
WHEN 1 THEN Amount
ELSE 0.0
END
) AS PeriodAmount01,
SUM( CASE PeriodMonth
WHEN 2 THEN Amount
ELSE 0.0
END
) AS PeriodAmount02,
SUM( CASE PeriodMonth
WHEN 3 THEN Amount
ELSE 0.0
END
) AS PeriodAmount03,
SUM( CASE PeriodMonth
WHEN 4 THEN Amount
ELSE 0.0
END
) AS PeriodAmount04,
SUM( CASE PeriodMonth
WHEN 5 THEN Amount
ELSE 0.0
END
) AS PeriodAmount05,
SUM( CASE PeriodMonth
WHEN 6 THEN Amount
ELSE 0.0
END
) AS PeriodAmount06,
SUM( CASE PeriodMonth
WHEN 7 THEN Amount
ELSE 0.0
END
) AS PeriodAmount07,
SUM( CASE PeriodMonth
WHEN 8 THEN Amount
ELSE 0.0
END
) AS PeriodAmount08,
SUM( CASE PeriodMonth
WHEN 9 THEN Amount
ELSE 0.0
END
) AS PeriodAmount09,
SUM( CASE PeriodMonth
WHEN 10 THEN Amount
ELSE 0.0
END
) AS PeriodAmount10,
SUM( CASE PeriodMonth
WHEN 11 THEN Amount
ELSE 0.0
END
) AS PeriodAmount11,
SUM( CASE PeriodMonth
WHEN 12 THEN Amount
ELSE 0.0
END
) AS PeriodAmount12,
SUM(Amount) AS TotalAmount
FROM ReportRevenuesLedger
GROUP BY PeriodYear,AccountNumber,AccountDescription
ORDER BY PeriodYear,AccountNumber,AccountDescription
I am trying to replace 15+ year old TxQuery with TVirtualQuery and I keep hitting a brick wall.
The first attempt SQL statement I tried against a memory table returned the the following results (TxQuery version works):
Is TVirtualQuery a beta beta component @ this point?
Error: Error: Access violation at address 02B9B1A2 in module 'TheVirtualTicketer.exe'. Read of address FFFFFFFC
SQL: SELECT PeriodYear,AccountNumber,AccountDescription,
SUM( CASE PeriodMonth
WHEN 1 THEN Amount
ELSE 0.0
END
) AS PeriodAmount01,
SUM( CASE PeriodMonth
WHEN 2 THEN Amount
ELSE 0.0
END
) AS PeriodAmount02,
SUM( CASE PeriodMonth
WHEN 3 THEN Amount
ELSE 0.0
END
) AS PeriodAmount03,
SUM( CASE PeriodMonth
WHEN 4 THEN Amount
ELSE 0.0
END
) AS PeriodAmount04,
SUM( CASE PeriodMonth
WHEN 5 THEN Amount
ELSE 0.0
END
) AS PeriodAmount05,
SUM( CASE PeriodMonth
WHEN 6 THEN Amount
ELSE 0.0
END
) AS PeriodAmount06,
SUM( CASE PeriodMonth
WHEN 7 THEN Amount
ELSE 0.0
END
) AS PeriodAmount07,
SUM( CASE PeriodMonth
WHEN 8 THEN Amount
ELSE 0.0
END
) AS PeriodAmount08,
SUM( CASE PeriodMonth
WHEN 9 THEN Amount
ELSE 0.0
END
) AS PeriodAmount09,
SUM( CASE PeriodMonth
WHEN 10 THEN Amount
ELSE 0.0
END
) AS PeriodAmount10,
SUM( CASE PeriodMonth
WHEN 11 THEN Amount
ELSE 0.0
END
) AS PeriodAmount11,
SUM( CASE PeriodMonth
WHEN 12 THEN Amount
ELSE 0.0
END
) AS PeriodAmount12,
SUM(Amount) AS TotalAmount
FROM ReportRevenuesLedger
GROUP BY PeriodYear,AccountNumber,AccountDescription
ORDER BY PeriodYear,AccountNumber,AccountDescription
SQL: SELECT PeriodYear,AccountNumber,AccountDescription,
SUM( CASE PeriodMonth
WHEN 1 THEN Amount
ELSE 0.0
END
) AS PeriodAmount01,
SUM( CASE PeriodMonth
WHEN 2 THEN Amount
ELSE 0.0
END
) AS PeriodAmount02,
SUM( CASE PeriodMonth
WHEN 3 THEN Amount
ELSE 0.0
END
) AS PeriodAmount03,
SUM( CASE PeriodMonth
WHEN 4 THEN Amount
ELSE 0.0
END
) AS PeriodAmount04,
SUM( CASE PeriodMonth
WHEN 5 THEN Amount
ELSE 0.0
END
) AS PeriodAmount05,
SUM( CASE PeriodMonth
WHEN 6 THEN Amount
ELSE 0.0
END
) AS PeriodAmount06,
SUM( CASE PeriodMonth
WHEN 7 THEN Amount
ELSE 0.0
END
) AS PeriodAmount07,
SUM( CASE PeriodMonth
WHEN 8 THEN Amount
ELSE 0.0
END
) AS PeriodAmount08,
SUM( CASE PeriodMonth
WHEN 9 THEN Amount
ELSE 0.0
END
) AS PeriodAmount09,
SUM( CASE PeriodMonth
WHEN 10 THEN Amount
ELSE 0.0
END
) AS PeriodAmount10,
SUM( CASE PeriodMonth
WHEN 11 THEN Amount
ELSE 0.0
END
) AS PeriodAmount11,
SUM( CASE PeriodMonth
WHEN 12 THEN Amount
ELSE 0.0
END
) AS PeriodAmount12,
SUM(Amount) AS TotalAmount
FROM ReportRevenuesLedger
GROUP BY PeriodYear,AccountNumber,AccountDescription
ORDER BY PeriodYear,AccountNumber,AccountDescription