I use VB6.0 to connect to a Sybase database. I have some sql that works with an Access Database, but will not work with the Sybase.
The sql looks like this:
SELECT HeaderTable.SwisCode, DetailTable.ParcelNumber, Sum(IIf(HeaderTable.SchoolOrVillage = 'S',round(DetailTable.BaseTax+DetailTable.FeeAmount,2),0)) AS school_relevy, Sum(IIf([HeaderTable].[SchoolOrVillage] = 'V', round(DetailTable.BaseTax+DetailTable.FeeAmount,2),0)) AS village_relevy
FROM HeaderTable INNER JOIN DetailTable ON HeaderTable.HeaderKey = DetailTable.HeaderRecNo
GROUP BY HeaderTable.SwisCode, DetailTable.ParcelNumber;
I put this sql into a string variable and issue the open method. It doesn't like the IIf(). I have looked through the Adaptive Server Anywhere SQL reference and that was of no help.
The sql looks like this:
SELECT HeaderTable.SwisCode, DetailTable.ParcelNumber, Sum(IIf(HeaderTable.SchoolOrVillage = 'S',round(DetailTable.BaseTax+DetailTable.FeeAmount,2),0)) AS school_relevy, Sum(IIf([HeaderTable].[SchoolOrVillage] = 'V', round(DetailTable.BaseTax+DetailTable.FeeAmount,2),0)) AS village_relevy
FROM HeaderTable INNER JOIN DetailTable ON HeaderTable.HeaderKey = DetailTable.HeaderRecNo
GROUP BY HeaderTable.SwisCode, DetailTable.ParcelNumber;
I put this sql into a string variable and issue the open method. It doesn't like the IIf(). I have looked through the Adaptive Server Anywhere SQL reference and that was of no help.