I've been using the query below in a CFC for months and today it started 
throwing random time out errors.  Nothing has changed.

Any thought as to why I may be getting errors on this query all of the sudden?


<cfquery name="random_poll" datasource="#application.dsn#">
SELECT TOP 1 portal_polls.poll_id, portal_polls.question, portal_polls.answer1, 
portal_polls.answer2, portal_polls.answer3, portal_polls.answer4, 
portal_polls.answer5, portal_polls.number_answers
FROM   portal_polls
WHERE  (portal_polls.start_date < #Now()# and portal_polls.end_date > #Now()#)
        and (everyone=1 OR exists (SELECT DISTINCT poll_id FROM 
portal_groups_x_polls, portal_students_x_groups WHERE 
portal_groups_x_polls.poll_id=portal_polls.poll_id and 
portal_students_x_groups.group_id=portal_groups_x_polls.group_id   and 
portal_students_x_groups.student_user_id=#session.userid#))
        and not exists (SELECT poll_id FROM portal_students_x_completed_polls 
WHERE portal_students_x_completed_polls.poll_id=portal_polls.poll_id and 
portal_students_x_completed_polls.student_user_id=#session.userid#)
        ORDER BY NEWID(); 
</cfquery>

Thanks,

Robert B. Harrison
Director of Interactive Services
Austin & Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be &.

Plug in to our blog: A&W Unplugged
http://www.austin-williams.com/unplugged


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348825
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to