I need to turn this SQL statement into CF syntax:
The code that follows is from a simple test page with just enough code to test this.
My query:
I have tried various ways to get this to work. This code simply returns the values of AMOUNT without making the D negative. THX, MDD
Code:
if :dr_dr_flag='D' then return (:amount*(-1)); else return (:amount); end if
My query:
Code:
<cfquery name="rsDocid" datasource="cgofprod">
SELECT distinct
fut.doc_cntl_num docid
,fut.dr_cr_flag
,fut.amount
FROM cgof_fund_use_trans fut
WHERE fut.doc_cntl_num LIKE upper('2803233tmx004000')
and batch_id = '03188FH6V'
</cfquery>
Code:
<cfoutput query="rsDocid" startrow="#StartRow_rsDocid#" maxrows="#MaxRows_rsDocid#">
<table width="75%" border="1">
<tr>
<td>#rsDocid.DOCID#</td>
<cfif #rsDocid.AMOUNT# EQ 'D'>
<td> (#rsDocid.AMOUNT#*-1) </td>
<cfelse> <td>#rsDocid.AMOUNT#</td>
</cfif>
<td>#rsDocid.DR_CR_FLAG#</td>
<td> </td>
<td> </td>
</tr>
</table>
I have tried various ways to get this to work. This code simply returns the values of AMOUNT without making the D negative. THX, MDD