UPDATE PollResult SET PartyPLink= WHERE PollResultID=;FINISH. SELECT PollResultID,m.PartyLink FROM PollResult as r,Poll as p,RaceMember as m WHERE r.AttachTo='Candidate' AND r.PartyPLink=0 AND p.PollID=r.ParentPoll AND p.AttachTo='Race' AND m.RaceLink=p.AttachID AND m.CandidateLink=r.AttachID;OUTPUT EachPPLPoll
EDIT POLL
SELECT SecLink FROM Security WHERE SecLink=70 AND UserLink=;OUTPUT NILSELECT SecLink FROM Security WHERE SecLink=71 AND UserLink=;OUTPUT NILCalculating
Race Calculate Poll AverageSELECT (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) FMidDay FROM Poll WHERE InvalidPoll='' AND AttachTo='Race' AND AttachID= ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) DESC LIMIT 1;OUTPUT NILBias=$in{Bias}>=$in{'PFW'.$in{CandidateLink}}+$in{ThisWeight}>=$in{'PFA'.$in{CandidateLink}}+(($in{Result}-$in{'PF'.$in{PollingFirmLink}.'Bias'.$in{PartyPLink}})*$in{ThisWeight})>
- ,Safe> : Weight SELECT PartyLink,Bias FROM PollFirmBias WHERE PollFirmLink=;OUTPUT GetPFBiasSELECT r.AttachID CandidateLink,r.PartyPLink,r.Result FROM PollResult as r JOIN RaceMember as m ON m.RaceLink= WHERE r.AttachTo='Candidate' AND r.ParentPoll= AND m.DropoutDate='0000-00-00' AND r.PartyPLink=;OUTPUT EachPollRes ='Y'>
FMidDay: SELECT PollID,PollStart,PollEnd,(TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) as MidDay,PollingFirmLink,InternalFor,WinGroup FROM Poll WHERE InvalidPoll='' AND AttachTo='Race' AND AttachID= AND (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) > ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart)) DESC;OUTPUT:
,Safe> x ,Safe> UPDATE RaceMember SET PollAvg= WHERE RaceLink= AND CandidateLink=;FINISHSELECT CandidateLink,PartyLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00';OUTPUT SetAverageUPDATE Poll SET DidPollAvg='Y' WHERE AttachTo='Race' AND AttachID=;FINISHSELECT DISTINCT AttachID FROM Poll WHERE DidPollAvg='' AND AttachTo='Race' ORDER BY PollEnd DESC LIMIT 50;OUTPUT EachMassRace eq 'SaveIt'>
INSERT INTO PollingFirm (Name,LastModified,FirstBy,LMBy,PartyLink,DefaultContactType) VALUES (,,,,'5',);OUTPUT NIL>UPDATE Poll SET Methodology=,ContactType=,Type=,ErrorMargin=,Details=,Sponsors=,GeographyLink=,InternalFor=,
PollStart=,PollEnd=,PollingFirmLink=,LMBy=,LastModify=,URL=,WinGroup=,InvalidPoll=
WHERE PollID=;OUTPUT NIL - Saved Changes UPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Approve';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Disapprove';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='DontKnow';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Favorable';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Unfavorable';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='DontKnow';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Recognized';OUTPUT NILUPDATE PollResult SET Result= WHERE ParentPoll= AND AttachTo='Unrecognized';OUTPUT NILINSERT INTO Poll (Methodology,ContactType,Type,ErrorMargin,Details,Sponsors,GeographyLink,InternalFor,PollStart,PollEnd,PollingFirmLink,FirstBy,LMBy,LastModify,AttachTo,AttachID,URL,WinGroup,InvalidPoll) VALUES
(,,,,,,,,,,,
,,,,,,,);OUTPUT NIL - Saved New Poll INSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Approve',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Disapprove',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'DontKnow',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Favorable',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Unfavorable',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'DontKnow',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Recognized',0,);OUTPUT NILINSERT INTO PollResult (ParentPoll,AttachTo,AttachID,Result) VALUES (,'Unrecognized',0,);OUTPUT NILSELECT Type RType,OfficeLink ROffLink,PollEnd RPollEnd,ParentContainer RPC FROM Race WHERE RaceID=;OUTPUT NILDELETE FROM PollResult WHERE ParentPoll= AND AttachTo='Candidate' AND AttachID=;OUTPUT NIL,SQL> ne ''>
INSERT INTO PollResult (AttachTo,AttachID,PartyPLink,Result,ParentPoll) VALUES ('Candidate',,,,SQL>,);OUTPUT NILSELECT CandidateLink,PartyLink FROM RaceMember WHERE RaceLink=;OUTPUTSaving Poll Groups: DELETE FROM PollResult WHERE ParentPoll= AND AttachTo='Candidate';OUTPUT NILSELECT PollEnd IPollEnd FROM Race WHERE ParentContainer= AND (Type='General Election' OR Type='Running Mate' OR Type='Special Election') AND PollEnd < ORDER BY PollEnd DESC LIMIT 1;OUTPUT NILSELECT RaceID PRaceID,PollEnd PPollEnd FROM Race WHERE ParentContainer= AND Type='Primary Election' AND PollEnd < AND PollEnd > ORDER BY PollEnd;OUTPUT CollectPrimariesSJPPty='Y'>: C,F%d> - C,F%f>% INSERT INTO PollResult (Grouping,AttachTo,AttachID,PartyPLink,Result,ParentPoll) VALUES (,'Candidate',C,F%d>,,C,F%f>,);OUTPUT NILGroup #: SELECT CandidateLink,FirstName,LastName,Name,Color,PartyID FROM RaceMember,Candidate,Party WHERE RaceLink= AND CandidateID=CandidateLink AND PartyID=RaceMember.PartyLink ORDER BY FinalVoteTotal DESC,Incumbent DESC,Party.Priority DESC,LastName,FirstName;OUTPUT CandGroupsCalculate Poll AverageSELECT ParentContainer RPC,PollEnd RPollEnd FROM Race WHERE RaceID=;OUTPUT NILSELECT (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) FMidDay FROM Poll WHERE AttachTo='Race' AND AttachID= ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) DESC LIMIT 1;OUTPUT NILSELECT RaceID,Title,Color,Name,CandidateID,FirstName,LastName,Photo,PollEnd,TakeOffice,TermEnd,WinVotes,SecondVotes,MaxWinners,AllVotes FROM Race,Candidate,RaceMember,Party
WHERE ParentContainer= AND TakesSeat='Y' AND Type='General Election' AND PollEnd < AND CandidateID=Winner AND RaceLink=RaceID AND CandidateLink=Winner AND PartyID=RaceMember.PartyLink ORDER BY PollEnd DESC,TakeOffice DESC LIMIT 1;OUTPUT NIL=$in{'PVotes'.$in{PartyLink}}+$in{FinalVoteTotal}>SELECT PartyLink,FinalVoteTotal FROM RaceMember WHERE RaceLink=;OUTPUT CalcAvg=$in{'PFW'.$in{CandidateLink}}+0.25>=$in{'PFA'.$in{CandidateLink}}+($in{TPcnt}*0)>
SELECT PartyLink,CandidateLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00' ORDER BY PollAvg DESC,CandidateLink;OUTPUT SetAverageBias=$in{Bias}>=$in{'PFW'.$in{CandidateLink}}+$in{ThisWeight}>=$in{'PFA'.$in{CandidateLink}}+(($in{Result}-$in{'PF'.$in{PollingFirmLink}.'Bias'.$in{PartyPLink}})*$in{ThisWeight})>
SELECT PartyLink,Bias FROM PollFirmBias WHERE PollFirmLink=;OUTPUT GetPFBiasSELECT AttachID CandidateLink,PartyPLink,Result FROM PollResult WHERE AttachTo='Candidate' AND ParentPoll= AND Grouping=;OUTPUT EachPollRes='Y'>
SELECT PollID TPID,Name,PollStart,PollEnd,(TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) as MidDay,PollingFirmLink,InternalFor,WinGroup FROM Poll,PollingFirm WHERE AttachTo='Race' AND AttachID= AND (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) > AND PollingFirmID=PollingFirmLink ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) DESC;OUTPUTUPDATE RaceMember SET PollAvg= WHERE RaceLink= AND CandidateLink=;FINISHSELECT CandidateLink,PartyLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00';OUTPUT SetAverage
if ($in{ROffLink} == 585) {
$xtmp=`curl -s 'https://www.ourcampaigns.com/OverviewMapPresGen.php'`;
}
>>
SELECT PollingFirmLink,Type,Methodology,ContactType,ErrorMargin,PollStart,PollEnd,URL,Details,Sponsors FROM Poll WHERE LMBy= ORDER BY LastModify DESC LIMIT 1;OUTPUT NILSELECT * FROM Poll WHERE PollID=;OUTPUT NIL
style="display:none;">
SELECT Result Approve FROM PollResult WHERE ParentPoll= AND AttachTo='Approve';OUTPUT NILSELECT Result Disapprove FROM PollResult WHERE ParentPoll= AND AttachTo='Disapprove';OUTPUT NILSELECT Result DontKnow FROM PollResult WHERE ParentPoll= AND AttachTo='DontKnow';OUTPUT NIL
Approve
%
Disapprove
%
Don't Know
%
style="display:none;">
SELECT Result Favorable FROM PollResult WHERE ParentPoll= AND AttachTo='Favorable';OUTPUT NILSELECT Result Unfavorable FROM PollResult WHERE ParentPoll= AND AttachTo='Unfavorable';OUTPUT NILSELECT Result FavUnknown FROM PollResult WHERE ParentPoll= AND AttachTo='DontKnow';OUTPUT NIL
Favorable
%
Unfavorable
%
Don't Know
%
style="display:none;">
SELECT Result Recognized FROM PollResult WHERE ParentPoll= AND AttachTo='Recognized';OUTPUT NILSELECT Result Unrecognized FROM PollResult WHERE ParentPoll= AND AttachTo='Unrecognized';OUTPUT NIL
The Return to Parent field link will take you back to the Race.
The Polling Firm pull-down is used to select the polling firm that conducted the poll.
Please do not create new ones unless no item in the list is appropriate.
Try to use the polling firm itself rather than the news media which purchased the poll if the information is available.
Straw Polls may be appropriate for convention or caucus races, but not for elections.
The Type pull-down selects the type of poll that was conducted.
Most of the time this will either by a Matchup, used for any Race polls, or an Approval poll for Job approvals of Approve, Disapprove and Don't Know.
New Types are almost never needed. Please do not create any unless you are sure you need a new one.
The Methodology pull-down selects the methodology the polling firm used. The most common are Adults, Registered Voters and Likely Voters.
Momentum numbers are only calculated between polls from the same Polling Firm that are conducted with the same methodology.
Please do not create new ones unless you are absolutely sure you need them.
If the Race itself provides information about the methodology, you do not need to reiterate it here - e.g. if the Race is a Republican Primary you should only need to use Likely Voters and not Likely Republican Voters.
Please do not create humorous methodologies. If ones are created, they will be changed to "Something Funny" and the creator may lose poll edit access.
If your poll releases more than one methodology with numbers, we prefer Likely Voters to Registered Voters and Registered Voters to Adults.
The Margin of Error and Sample Size text fields measure the uncertainty of the poll. Entering one will cause the other to be calculated.
If you only have one of the two, enter it in the appropriate box. If you have both, Sample Size is preferred. If you have neither, use 5% MoE and note the lack of data in the Details field.
The Poll Start and Poll End date fields are set to the days the poll was conducted. Most polls do not specify time, so these should be left at a default 9am-5pm unless time is specified.
If this information is not known, use your best guess and note the lack of information in the Details box.
Use the Website field to provide a link to a website or pdf where you found the poll information.
The Sponsor(s) field should be used to list the media or other entities who paid for the poll.
It should always be used if the poll is an internal campaign poll or a poll sponsored by one of the partisan committees.
The Details field allows you to put some extra information about this poll. It should always be used to note if any of the above information is just a guess rather than sourced data.
This field can be used to note some other internal information about the poll, but should not be used to provide complete poll internals.
The Last Edited area will show the User who last edited this Poll.
At the end, each Candidate in the race will be listed along with their Party and a box to enter their Poll result. We prefer results that include leaners if numbers are provided
with and without.