A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

QUERY FIELD SUM



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2010, 09:04 PM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed
  #2  
Old May 4th, 2010, 09:27 PM posted to microsoft.public.access.queries
ghetto_banjo
external usenet poster
 
Posts: 325
Default QUERY FIELD SUM

should be as easy as:

L: [K] + [H]


However, you see that you are returning "1" which is a string, as
opposed 1 the number. You might want to change the values to 2, 1,
and 0 depending on what you are trying to accomplish.
  #3  
Old May 4th, 2010, 09:43 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default QUERY FIELD SUM

What would i write in my third field to get the sum of K + H ?
Z: IIF([PL4HX4.RK]=1, 2, IIF([PL4HX4.RK]=2, 1, 0)) + IIF([PL4HX4.RH]=1,
2, IIF([PL4HX4.RH]=2, 1, 0))

Using the quotes around the digits to show for condition results would give
you this -- 21 or 11 or 12 or 22 instead of 3 or 2 or 3 or 4.

If you use the quotes it is text output so that when you use the plus sign
with text it concatenates the information rather than summing.

--
Build a little, test a little.


"gambler" wrote:

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed

  #4  
Old May 5th, 2010, 12:16 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM

KARL
Do you give any help over the phone? If so what do you charge?
Thanks
ed

"KARL DEWEY" wrote:

What would i write in my third field to get the sum of K + H ?

Z: IIF([PL4HX4.RK]=1, 2, IIF([PL4HX4.RK]=2, 1, 0)) + IIF([PL4HX4.RH]=1,
2, IIF([PL4HX4.RH]=2, 1, 0))

Using the quotes around the digits to show for condition results would give
you this -- 21 or 11 or 12 or 22 instead of 3 or 2 or 3 or 4.

If you use the quotes it is text output so that when you use the plus sign
with text it concatenates the information rather than summing.

--
Build a little, test a little.


"gambler" wrote:

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed

  #5  
Old May 5th, 2010, 12:28 AM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default QUERY FIELD SUM

No phone, no web sites, no viewing your web site.

If the Access problem seems interesting I respond.

--
Build a little, test a little.


"gambler" wrote:

KARL
Do you give any help over the phone? If so what do you charge?
Thanks
ed

"KARL DEWEY" wrote:

What would i write in my third field to get the sum of K + H ?

Z: IIF([PL4HX4.RK]=1, 2, IIF([PL4HX4.RK]=2, 1, 0)) + IIF([PL4HX4.RH]=1,
2, IIF([PL4HX4.RH]=2, 1, 0))

Using the quotes around the digits to show for condition results would give
you this -- 21 or 11 or 12 or 22 instead of 3 or 2 or 3 or 4.

If you use the quotes it is text output so that when you use the plus sign
with text it concatenates the information rather than summing.

--
Build a little, test a little.


"gambler" wrote:

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed

  #6  
Old May 5th, 2010, 01:01 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM

Thanks for responding.


"KARL DEWEY" wrote:

No phone, no web sites, no viewing your web site.

If the Access problem seems interesting I respond.

--
Build a little, test a little.


"gambler" wrote:

KARL
Do you give any help over the phone? If so what do you charge?
Thanks
ed

"KARL DEWEY" wrote:

What would i write in my third field to get the sum of K + H ?
Z: IIF([PL4HX4.RK]=1, 2, IIF([PL4HX4.RK]=2, 1, 0)) + IIF([PL4HX4.RH]=1,
2, IIF([PL4HX4.RH]=2, 1, 0))

Using the quotes around the digits to show for condition results would give
you this -- 21 or 11 or 12 or 22 instead of 3 or 2 or 3 or 4.

If you use the quotes it is text output so that when you use the plus sign
with text it concatenates the information rather than summing.

--
Build a little, test a little.


"gambler" wrote:

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed

  #7  
Old May 5th, 2010, 01:27 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM

I did some research on google and i understand you equation. My problem now
is i will have maybe 30 IIf statements to add up. Since they will be going
from left to right across my sheet, how would i add them . I can write one
statement like you did above. I would really be long. How do you suggest i do
it,and i will do some more reading.
Im going from left to right because im doing horse racing and im look at
each horse in the race seperetyl.
Sure appreciate any help
Thanks Karl
ed

"KARL DEWEY" wrote:

What would i write in my third field to get the sum of K + H ?

Z: IIF([PL4HX4.RK]=1, 2, IIF([PL4HX4.RK]=2, 1, 0)) + IIF([PL4HX4.RH]=1,
2, IIF([PL4HX4.RH]=2, 1, 0))

Using the quotes around the digits to show for condition results would give
you this -- 21 or 11 or 12 or 22 instead of 3 or 2 or 3 or 4.

If you use the quotes it is text output so that when you use the plus sign
with text it concatenates the information rather than summing.

--
Build a little, test a little.


"gambler" wrote:

In have the following in my first field.
K:IIF([PL4HX4.RK]=1,"2",IIF([PL4HX4.RK]=2,"1",""))
I have the following in my second field.
H:IIF([PL4HX4.RH]=1,"2",IIF([PL4HX4.RH]=2,"1",""))
What would i write in my third field to get the sum of K + H ?
Thanks
ed

  #8  
Old May 5th, 2010, 01:36 AM posted to microsoft.public.access.queries
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default QUERY FIELD SUM

gambler wrote:
I did some research on google and i understand you equation. My problem now
is i will have maybe 30 IIf statements to add up. Since they will be going
from left to right across my sheet, how would i add them . I can write one
statement like you did above. I would really be long. How do you suggest i do
it,and i will do some more reading.
Im going from left to right because im doing horse racing and im look at
each horse in the race seperetyl.
Sure appreciate any help
Thanks Karl
ed


Usually that's a sign that you need to normalize. Generally, tables should
be tall and slim, not short and fat. Short and fat is almost always an
indication of design problems. Then you can use totals queries. Much easier
and faster.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

  #9  
Old May 5th, 2010, 02:31 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM



"PieterLinden via AccessMonster.com" wrote:

gambler wrote:
I did some research on google and i understand you equation. My problem now
is i will have maybe 30 IIf statements to add up. Since they will be going
from left to right across my sheet, how would i add them . I can write one
statement like you did above. I would really be long. How do you suggest i do
it,and i will do some more reading.
Im going from left to right because im doing horse racing and im look at
each horse in the race seperetyl.
Sure appreciate any help
Thanks Karl
ed


Usually that's a sign that you need to normalize. Generally, tables should
be tall and slim, not short and fat. Short and fat is almost always an
indication of design problems. Then you can use totals queries. Much easier
and faster.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

.

  #10  
Old May 5th, 2010, 02:32 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default QUERY FIELD SUM

Ill have to read some more.
Thanks
ed

"PieterLinden via AccessMonster.com" wrote:

gambler wrote:
I did some research on google and i understand you equation. My problem now
is i will have maybe 30 IIf statements to add up. Since they will be going
from left to right across my sheet, how would i add them . I can write one
statement like you did above. I would really be long. How do you suggest i do
it,and i will do some more reading.
Im going from left to right because im doing horse racing and im look at
each horse in the race seperetyl.
Sure appreciate any help
Thanks Karl
ed


Usually that's a sign that you need to normalize. Generally, tables should
be tall and slim, not short and fat. Short and fat is almost always an
indication of design problems. Then you can use totals queries. Much easier
and faster.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.