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
|
|||
|
|||
Help with field
Hi,
I have a table for storing election result as below CEID Autonumber CE_CommuneID Foreign Key to Commune Table CE_PartyID Number Foreign Key to Party Table CE_NumberOfVote Text CE_NumberOfSeat Text I use Text filed type for CE_NumberOfVotes and CE_NumberOfSeat as I want also to display "No Candidate" in place of CE_NumberOfVote. Now I am facing a problem of summarize the NumberOfVote and NumberOfSeat. Could someone advice on the table structure SF |
#2
|
|||
|
|||
Help with field
hi,
SF wrote: CE_NumberOfVote Text CE_NumberOfSeat Text I use Text filed type for CE_NumberOfVotes and CE_NumberOfSeat as I want also to display "No Candidate" in place of CE_NumberOfVote. Now I am facing a problem of summarize the NumberOfVote and NumberOfSeat. Make it a Long Integer field and allow Null. If you want to store "No Candidate" store Null, or if you need Null to indicate no entry, use a magic number, e.g. -666. So you can sum it SELECT Sum(CE_NumberOfVote) FROM Table WHERE NOT IsNull(CE_NumberOfVote) or SELECT Sum(CE_NumberOfVote) FROM Table WHERE CE_NumberOfVote -666 mfG -- stefan -- |
#3
|
|||
|
|||
Help with field
It works, Thank you
SF "Stefan Hoffmann" wrote in message ... hi, SF wrote: CE_NumberOfVote Text CE_NumberOfSeat Text I use Text filed type for CE_NumberOfVotes and CE_NumberOfSeat as I want also to display "No Candidate" in place of CE_NumberOfVote. Now I am facing a problem of summarize the NumberOfVote and NumberOfSeat. Make it a Long Integer field and allow Null. If you want to store "No Candidate" store Null, or if you need Null to indicate no entry, use a magic number, e.g. -666. So you can sum it SELECT Sum(CE_NumberOfVote) FROM Table WHERE NOT IsNull(CE_NumberOfVote) or SELECT Sum(CE_NumberOfVote) FROM Table WHERE CE_NumberOfVote -666 mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|