Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid question

Status
Not open for further replies.

chinkoh

Programmer
Mar 15, 2002
8
MY
My table

Acc Date Type Amt
--- ---------- --- -----
A001 01/01/2001 D 1000
A002 01/01/2001 C 1000

how display in grid look like this.

Acc. Date Debit Credit
---- ---------- ----- ------
A001 01/01/2001 1000
A002 01/01/2001 1000

thank you
 
HI
Create a Debit Column and a credit column in the grid and display &quot;WHEN&quot; 0-amt < 0 or amt > 0 respectivelt. The when event is the key.

If you want to extract that as an SQL,
SELECT *, IIF(amt <0, 0-amt,amt-amt) AS debit, ;
IIF(amt>0,amt,amt-amt) AS Credit FROM myTable ;
INTO Cursor mycursor ... etc..
Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
You can also use a controlsurce expression:

column1: controlsource = 'IIF(amt > 0, amt, 0)'
column2: controlsource = 'IIF(amt < 0, amt, 0)'

So if the amount is smaller than 0, the second column will display the amount and if not, it will show 0.
For the first column the other way around.

You can also make the textbox of the column not show 0 values, or show them as blank.

HTH,

Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top