John,
I'll assume that your transaction table has the fields cTransactionType ("BUY" or "SELL") and yTransactionAmount.
Try
SELECT TYPE, ;
TOTAL * iif(TYPE = "BUY", 1, -1) as TOTAL ;
FROM Transaction ;
yada, yada, yada ...
Cheers,
Andrew
>I do have a query like: SELECT TYPE, TOTAL from Transaction
>which results something like:
>TYPE TOTAL
>BUY 2000
>SELL 1000
>SELL 500
>
>However I would like to have the result like this
>BUY + 2000
>SELL - 1000
>SELL - 500
>
>So depending on the TYPE there will be a + / - before the TOTAL.
>How can I make that happen ?
>
>Thanks
>
>John
>
>PS: feel free to send suggestions to my private emailaddress
If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?
From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."
All my FoxTalk and other articles are available on my
web site.
Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.