Using the sum option for 2 different codes in the same field

P

PaulinaDi

I want to use the Sum option on my report but I have 2 different currency
codes on the same field (MN and USD). How may I get a report with these two
codes separated? First all the expenses based on MN and then all the ones on
USD. I have this field using a combo box (created with the Wizard)
 
A

Al Campagna

Paulina,
You'll need to tell Access what format your data requires by adding a field to your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as long as you're only
working withn two currencies (USD and MN) (I don't know what MN signifies... Mexican?)
Your formating and reporting grouping (for summing) could be based upon whether
CurrencyType equals True for USD, False for MN, or a value of "USD" and "MN"... etc...
 
P

PaulinaDi

I have many fields on my table but the ones for this case are Amount and
CurrencyType. I want my report to display me the Sum for the Amounts based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!
 
P

PaulinaDi

Thanks in advanced. I found a subject very similar about what I was trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))
 
A

Al Campagna

That should do it...
Be careful of that Abs. If you have any negative values, they will be added as though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

PaulinaDi said:
Thanks in advanced. I found a subject very similar about what I was trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

PaulinaDi said:
I have many fields on my table but the ones for this case are Amount and
CurrencyType. I want my report to display me the Sum for the Amounts based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!
 
P

PaulinaDi

Very good point so, what should I use instead of ABS? to get the same result?

Al Campagna said:
That should do it...
Be careful of that Abs. If you have any negative values, they will be added as though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

PaulinaDi said:
Thanks in advanced. I found a subject very similar about what I was trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

PaulinaDi said:
I have many fields on my table but the ones for this case are Amount and
CurrencyType. I want my report to display me the Sum for the Amounts based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by adding a field to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as long as you're
only
working withn two currencies (USD and MN) (I don't know what MN signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be based upon whether
CurrencyType equals True for USD, False for MN, or a value of "USD" and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

I want to use the Sum option on my report but I have 2 different currency
codes on the same field (MN and USD). How may I get a report with these two
codes separated? First all the expenses based on MN and then all the ones on
USD. I have this field using a combo box (created with the Wizard)
 
A

Al Campagna

Paulina,
Sum(([Moneda]="MN")*[Monto])
should do it.

The Abs function refers to the "Absolute" value of a number.
Abs(+10) = 10 and Abs(-10) = 10
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


PaulinaDi said:
Very good point so, what should I use instead of ABS? to get the same result?

Al Campagna said:
That should do it...
Be careful of that Abs. If you have any negative values, they will be added as
though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

PaulinaDi said:
Thanks in advanced. I found a subject very similar about what I was trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

:

I have many fields on my table but the ones for this case are Amount and
CurrencyType. I want my report to display me the Sum for the Amounts based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by adding a field to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as long as you're
only
working withn two currencies (USD and MN) (I don't know what MN signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be based upon
whether
CurrencyType equals True for USD, False for MN, or a value of "USD" and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

I want to use the Sum option on my report but I have 2 different currency
codes on the same field (MN and USD). How may I get a report with these two
codes separated? First all the expenses based on MN and then all the ones on
USD. I have this field using a combo box (created with the Wizard)
 
J

John Spencer

Try

Sum(IIF([Moneda]="MN",[Monto],null))



Al Campagna said:
Paulina,
Sum(([Moneda]="MN")*[Monto])
should do it.

The Abs function refers to the "Absolute" value of a number.
Abs(+10) = 10 and Abs(-10) = 10
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


PaulinaDi said:
Very good point so, what should I use instead of ABS? to get the same
result?

Al Campagna said:
That should do it...
Be careful of that Abs. If you have any negative values, they will
be added as though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Thanks in advanced. I found a subject very similar about what I was
trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

:

I have many fields on my table but the ones for this case are Amount
and
CurrencyType. I want my report to display me the Sum for the Amounts
based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by
adding a field to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as
long as you're
only
working withn two currencies (USD and MN) (I don't know what MN
signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be
based upon whether
CurrencyType equals True for USD, False for MN, or a value of "USD"
and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

I want to use the Sum option on my report but I have 2 different
currency
codes on the same field (MN and USD). How may I get a report with
these two
codes separated? First all the expenses based on MN and then all
the ones on
USD. I have this field using a combo box (created with the
Wizard)
 
P

PaulinaDi

Thanks both of you. It worked for me. I just have one question:

Why does the expression =Sum([Moneda]="MN",[Monto]) brings me a negative
result and the expression =Sum(IIF([Moneda]="MN",[Monto],null)) brings me
a positive one?????

The correct one in fact is the positive one.

THANKS AGAIN BOTH OF YOU!


John Spencer said:
Try

Sum(IIF([Moneda]="MN",[Monto],null))



Al Campagna said:
Paulina,
Sum(([Moneda]="MN")*[Monto])
should do it.

The Abs function refers to the "Absolute" value of a number.
Abs(+10) = 10 and Abs(-10) = 10
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


PaulinaDi said:
Very good point so, what should I use instead of ABS? to get the same
result?

:

That should do it...
Be careful of that Abs. If you have any negative values, they will
be added as though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Thanks in advanced. I found a subject very similar about what I was
trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

:

I have many fields on my table but the ones for this case are Amount
and
CurrencyType. I want my report to display me the Sum for the Amounts
based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by
adding a field to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as
long as you're
only
working withn two currencies (USD and MN) (I don't know what MN
signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be
based upon whether
CurrencyType equals True for USD, False for MN, or a value of "USD"
and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

I want to use the Sum option on my report but I have 2 different
currency
codes on the same field (MN and USD). How may I get a report with
these two
codes separated? First all the expenses based on MN and then all
the ones on
USD. I have this field using a combo box (created with the
Wizard)
 
J

John Spencer

=Sum([Moneda]="MN"*[Monto]) brings me a negative. That is because
[Moneda]="MN" returns True (-1) or False (0).

So you are are in effect multiplying Monto by zero or -1 to return zero or
the negative value of Monto.

The second expression, returns the value of Monto or Null.


PaulinaDi said:
Thanks both of you. It worked for me. I just have one question:

Why does the expression =Sum([Moneda]="MN",[Monto]) brings me a
negative
result and the expression =Sum(IIF([Moneda]="MN",[Monto],null)) brings
me
a positive one?????

The correct one in fact is the positive one.

THANKS AGAIN BOTH OF YOU!


John Spencer said:
Try

Sum(IIF([Moneda]="MN",[Monto],null))



Al Campagna said:
Paulina,
Sum(([Moneda]="MN")*[Monto])
should do it.

The Abs function refers to the "Absolute" value of a number.
Abs(+10) = 10 and Abs(-10) = 10
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Very good point so, what should I use instead of ABS? to get the same
result?

:

That should do it...
Be careful of that Abs. If you have any negative values, they
will
be added as though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Thanks in advanced. I found a subject very similar about what I was
trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

:

I have many fields on my table but the ones for this case are
Amount
and
CurrencyType. I want my report to display me the Sum for the
Amounts
based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by
adding a field to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option
frame...as
long as you're
only
working withn two currencies (USD and MN) (I don't know what MN
signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be
based upon whether
CurrencyType equals True for USD, False for MN, or a value of
"USD"
and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

message
I want to use the Sum option on my report but I have 2
different
currency
codes on the same field (MN and USD). How may I get a report
with
these two
codes separated? First all the expenses based on MN and then
all
the ones on
USD. I have this field using a combo box (created with the
Wizard)
 
A

Al Campagna

Missed that... thanks.
Al Campagna

John Spencer said:
Try

Sum(IIF([Moneda]="MN",[Monto],null))



Al Campagna said:
Paulina,
Sum(([Moneda]="MN")*[Monto])
should do it.

The Abs function refers to the "Absolute" value of a number.
Abs(+10) = 10 and Abs(-10) = 10
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


PaulinaDi said:
Very good point so, what should I use instead of ABS? to get the same result?

:

That should do it...
Be careful of that Abs. If you have any negative values, they will be added as
though
they were positive.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Thanks in advanced. I found a subject very similar about what I was trying to
achieve and here it is: =Abs(Sum(([Moneda]="MN")*[Monto]))

:

I have many fields on my table but the ones for this case are Amount and
CurrencyType. I want my report to display me the Sum for the Amounts based on
USD and the Sum for the Amounts based on MN (Mexican Peso). EX:

1200 MN
1500 MN
130 USD
120 USD
150 USD
1800 MN

SUM = 4500 MN and 300 USD

Thanks Again!




:

Paulina,
You'll need to tell Access what format your data requires by adding a field
to
your
table called something like CurrencyType.
A checkbox would do, or a Listbox, or 2 choice Option frame...as long as
you're
only
working withn two currencies (USD and MN) (I don't know what MN signifies...
Mexican?)
Your formating and reporting grouping (for summing) could be based upon
whether
CurrencyType equals True for USD, False for MN, or a value of "USD" and "MN"...
etc...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

I want to use the Sum option on my report but I have 2 different currency
codes on the same field (MN and USD). How may I get a report with these two
codes separated? First all the expenses based on MN and then all the ones on
USD. I have this field using a combo box (created with the Wizard)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top