help me plzzz

  • Thread starter Thread starter mike via AccessMonster.com
  • Start date Start date
M

mike via AccessMonster.com

Hi,,

If i had a report that looks like this:

QtyOnhand Qty_initial Gain Loss
35 50
15
50 52
2
75 80
5
80 60 20
150 50 100


The Qtyonhand and Qtyinitial is what i have right: How can i calculate the
gain and loss. what is the correct expression for getting the gain and loss.
By the way gain and loss has different textbox.

thanks again...
 
It seems like you have the gain/loss calculated properly. Is the problem
that Gain/Loss are separate textboxes? Maybe you could simply prefix a loss
with a minus sign, or display it inside (...) and combine the two into a
single text box?

I guess I'm not sure what the question is, unless these are hand calculated
for display purposes. If the problem is that Gain and Loss are two separate
values as this stands, you could do:

SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "
") as Gain,
IIf(Qty_Initial - QtyOnHand < 0, QtyOnHand - Qty_Initial, "
") as Loss
FROM [Your Table];

Good Luck!
 
thank you,, i think my work was just some kind of complicated.. ah heres my
simple question: How can i display the data in my textbox for those positve
number only.. lets say:

table1

field1
4
5
8
7
-6
-9

I want them to display in the textbox for those + sign numbers only... thanks






It seems like you have the gain/loss calculated properly. Is the problem
that Gain/Loss are separate textboxes? Maybe you could simply prefix a loss
with a minus sign, or display it inside (...) and combine the two into a
single text box?

I guess I'm not sure what the question is, unless these are hand calculated
for display purposes. If the problem is that Gain and Loss are two separate
values as this stands, you could do:

SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "
") as Gain,
IIf(Qty_Initial - QtyOnHand < 0, QtyOnHand - Qty_Initial, "
") as Loss
FROM [Your Table];

Good Luck!
--

Chaim
Hi,,
[quoted text clipped - 14 lines]

thanks again...
 
SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "") as Gain
FROM [Your Table];

What do you want if the value is negative? This will display a zero length
string if the value is negative- visually, nothing. If the text box is bound
to the Gain column, either the Gain or nothing will be displayed.

Good Luck!
--

Chaim


mike via AccessMonster.com said:
thank you,, i think my work was just some kind of complicated.. ah heres my
simple question: How can i display the data in my textbox for those positve
number only.. lets say:

table1

field1
4
5
8
7
-6
-9

I want them to display in the textbox for those + sign numbers only... thanks






It seems like you have the gain/loss calculated properly. Is the problem
that Gain/Loss are separate textboxes? Maybe you could simply prefix a loss
with a minus sign, or display it inside (...) and combine the two into a
single text box?

I guess I'm not sure what the question is, unless these are hand calculated
for display purposes. If the problem is that Gain and Loss are two separate
values as this stands, you could do:

SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "
") as Gain,
IIf(Qty_Initial - QtyOnHand < 0, QtyOnHand - Qty_Initial, "
") as Loss
FROM [Your Table];

Good Luck!
--

Chaim
[quoted text clipped - 14 lines]
thanks again...
 
I dont get it, im sorry...

All i wanted is if the qtyinitial is greater than the qtyonhand it will
display into the GAIN texbox and if the qtyinitial is lesser than the
qtyonhand it will goes to loss textbox.

i dont know how to put this code is it in the expression builder or in the
property of the gain and loss text box?

thanks for your time ...
SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "") as Gain
FROM [Your Table];

What do you want if the value is negative? This will display a zero length
string if the value is negative- visually, nothing. If the text box is bound
to the Gain column, either the Gain or nothing will be displayed.

Good Luck!
--

Chaim
thank you,, i think my work was just some kind of complicated.. ah heres my
simple question: How can i display the data in my textbox for those positve
[quoted text clipped - 38 lines]
 
mike said:
I dont get it, im sorry...

All i wanted is if the qtyinitial is greater than the qtyonhand the diffrence will
display into the GAIN texbox and if the qtyinitial is lesser than the
qtyonhand the diffirence will goes to loss textbox.

i dont know how to put this code is it in the expression builder or in the
property of the gain and loss text box?

thanks for your time ...
SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "") as Gain
[quoted text clipped - 14 lines]
 
I dont get it, im sorry...

All i wanted is if the qtyinitial is greater than the qtyonhand the
difference will
display into the GAIN texbox and if the qtyinitial is lesser than the
qtyonhand the difference will goes to loss textbox.

i dont know how to put this code is it in the expression builder or in the
property of the gain and loss text box?

thanks for your time ...

SELECT QtyOnHand, Qty_Initial,
IIf(Qty_Initial - QtyOnHand > 0, Qty_Initial - QtyOnHand, "") as Gain
[quoted text clipped - 14 lines]
 
Back
Top