I'm using the following select statement to populate a datagrid on a .net web page.
select ITEM_CODE_KEY, CHARGE_AMT, FS_CHARGE_AMT, HAULERS_AMT, FS_HAULERS_AMT
from ITEM_CHARGE_DETL
where ORDER_NO = 12345 and OWNER_NO = 98765
My problem is I want to use one field if it's not zero (or null), otherwise use another field to populate the column.
When I use the following HTML it returns an error of 'Expression expected.' What am I doing wrong, or is there a better way of doing this?
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label>
<%# if databinder.eval(container.dataitem, "FS_CHARGE_AMT" <> 0 then
databinder.eval(container.dataitem, "FS_CHARGE_AMT"
else
databinder.eval(container.dataitem, "CHARGE_AMT"
endif %>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>