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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|