I didn't want to get too wordy in my intial explanation and without sending you the entire App it will be tuff to explain but a few points.<BR>*This is an election for a local council (mayor and committee a and committe b etc)<BR>*In each category there is a record called "informal" and "blank" - these are for defaced and blank postal votes.These also need to be shown but need to be at the foot of the list regardless of howmany votes they amount to. This explains the 2 SELECTS. "Anon" is a field that determines these informals against a real person. There is a table called issue which states (numeric) how many people will be voted onto committee X from a list of possible candidates. Mayor will obviously only yeild one winner whereas local health may yield 6 winners from 20 candidates - hope you are getting this :)<BR><BR>Sooooo if the person clicks on "health board election results" the SQL would select people where issue=4. Looking in table issue we can see that there will be 6 elected from the list hence our output needs to resemble...<BR><BR>Bill. 1200. elected<BR>Bob. 999. elected<BR>Jane. 800. elected<BR>Sue. 799. elected<BR>John. 700. elected<BR>Mark. 600. elected<BR>Peter. 450.<BR>Larry. 300.<BR>Claire. 200.<BR>Informal. 17.<BR><BR>So I need to loop through the RS X number of times (where X is the numeric found in issue) and append "election to the record. Then continue to loop without this appendage. *phew!* I need to lie down after all that<BR>Blank. 4.
email me email@example.com<BR><BR>Send me the schemas for both tables (and other tables if they are useful?).<BR><BR>I *really* think you have a "normalization" problem in this DB.<BR><BR>If you want to be nice, send me the code you posted so I don't have to copy/paste it from these ugly forums and thereby lose any indentation you might have (hopefully!) put in.<BR><BR>