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
|
|||
|
|||
How do I add 5 seperate number entries into a single line total?
I have converted 5 separate field date entries into separate fields
converting them to a numeric value. I need to add each one to the other for a total line entry. Each one looks for a date entry, then shows a number 1 for it. example: 1CapDateNbr: IIf([1Capdate]=Yes,"1"," ") 2CapDateNbr: IIf([2Capdate]=Yes,"1"," ") 3CapDateNbr: IIf([3Capdate]=Yes,"1"," ") 4CapDateNbr: IIf([4Capdate]=Yes,"1"," ") 5CapDateNbr: IIf([5Capdate]=Yes,"1"," ") I need to add them together. Thanks for your help. |
#2
|
|||
|
|||
How do I add 5 seperate number entries into a single line total?
Try returning a number, instead of a string.
5CapDateNbr: IIf([5Capdate]=Yes,1,0) If 5Capdate is a boolean value then you could just add the five fields together and use Abs to convert the negative value to a postive value Abs(1CapDateNbr+2CapDateNbr+3CapDateNbr+4CapDateNb r+5CapDateNbr) Based on the field names, I suspect that you really need to change your table structure since this looks as if your data is not normalized. -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "TEM" wrote in message ... I have converted 5 separate field date entries into separate fields converting them to a numeric value. I need to add each one to the other for a total line entry. Each one looks for a date entry, then shows a number 1 for it. example: 1CapDateNbr: IIf([1Capdate]=Yes,"1"," ") 2CapDateNbr: IIf([2Capdate]=Yes,"1"," ") 3CapDateNbr: IIf([3Capdate]=Yes,"1"," ") 4CapDateNbr: IIf([4Capdate]=Yes,"1"," ") 5CapDateNbr: IIf([5Capdate]=Yes,"1"," ") I need to add them together. Thanks for your help. |
#3
|
|||
|
|||
How do I add 5 seperate number entries into a single line tota
Thanks John, I'll give that a try. I recently enherited this database and am
trying to make it work, but the more I work with it, the more I see the need to make alot of sturcture changes. Thanks again "John Spencer" wrote: Try returning a number, instead of a string. 5CapDateNbr: IIf([5Capdate]=Yes,1,0) If 5Capdate is a boolean value then you could just add the five fields together and use Abs to convert the negative value to a postive value Abs(1CapDateNbr+2CapDateNbr+3CapDateNbr+4CapDateNb r+5CapDateNbr) Based on the field names, I suspect that you really need to change your table structure since this looks as if your data is not normalized. -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "TEM" wrote in message ... I have converted 5 separate field date entries into separate fields converting them to a numeric value. I need to add each one to the other for a total line entry. Each one looks for a date entry, then shows a number 1 for it. example: 1CapDateNbr: IIf([1Capdate]=Yes,"1"," ") 2CapDateNbr: IIf([2Capdate]=Yes,"1"," ") 3CapDateNbr: IIf([3Capdate]=Yes,"1"," ") 4CapDateNbr: IIf([4Capdate]=Yes,"1"," ") 5CapDateNbr: IIf([5Capdate]=Yes,"1"," ") I need to add them together. Thanks for your help. |
Thread Tools | |
Display Modes | |
|
|