Thanks to the people who've tested my poll for me at
http://www.choice.com.au/calculators/poll_merger1.cfm.  It's very
frustrating, because it works fine for me, but not, apparently for some of
you cf-listers here.

The error message we're getting is:

[quote]
Parameter 2 of function DateDiff which is now "" must be a date/time value
The error occurred while evaluating the expression:

  (datediff("y", testvoter.latestvote ,now()) is '0')
[end quote]

There is definitely a date in every record in the table.

Here's the template segment that produces this error:

<!--- Detect if the user has voted already today ---->
<CFQUERY NAME="testvoter" DATASOURCE="Calculators">
SELECT      
max(whenvotes) as latestvote
FROM         poll_merger_1 
Where remote_addr='#remote_addr#'
</CFQUERY>

<!--- Test for did/didn't vote already --->
<!--- no records indicates hasn't voted yet. --->
   <cfif testvoter.recordcount eq '0'>
      <cfset dovote="yes"> 
   <Cfelseif  #testvoter.recordcount# GT '0'>
<!---  Check how long ago he voted. --->
<!---  If the date is today's date set to no, otherwise ok to vote  --->  
    <cfif  (datediff("y", testvoter.latestvote ,now()) is '0')>
       <cfSet dovote = "no">
    <cfelse>
       <cfset dovote="yes"> 
    </cfif>
  </cfif

 <!--- If yes, jump the vote processing to the counting. --->
... yada yada  

So, I'm puzzled - what about this template causes this test to work when
I'm watching it, but as soon as I turn my back with a smug smile on my
face thinking I've got it licked, it hiccups on me?

What I've checked so far:

That there's a valid date in every record in the table
That the template has uploaded to the site without corruption
That it's nothing to do with the specific ip address or firewall
configuration - I've tried this from inside the firewall and outside from
my home computer.

Any ideas?

Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia 
http://www.afp.zip.com.au
http://www.choice.com.au


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to