Connecting Tech Pros Worldwide Help | Site Map

The trouble with Zero...

Member
 
Join Date: Mar 2007
Posts: 94
#1: May 12 '09
Hi,

My CF query script isn't bringing up the same result in Access, and I think it's the way zeroes are handled that's the problem.

My Access query has three query fields - two for text and one for a number range when the number is >=0 And <=2.9

Access brings a result of 16. CF brings a result of 42!

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="KWBand1S" dbtype="query">
  2.         select         ClientFK,
  3.                 ResponseLevelFK,
  4.                 PowerRating    
  5.         from         getPumps
  6.         where        ResponseLevelFK like 'Standard'
  7.                 and (PowerRating >=0
  8.                 and PowerRating <=2.9)
  9.         </cfquery>
If I change the query to
Expand|Select|Wrap|Line Numbers
  1. ResponseLevelFK like 'Standard'
  2.                 and (PowerRating >0
  3.                 and PowerRating <=2.9)
(ie change >=0 to >0.
Then it brings up 16. But I'm not sure then that is doing the same thing as my Access query...

Can anyone help?
Cheers
Neil
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: May 12 '09

re: The trouble with Zero...


Are the rest set as NULL? Perhaps Coldfusion is treating them as 0.
Member
 
Join Date: Mar 2007
Posts: 94
#3: May 12 '09

re: The trouble with Zero...


Yes, they are, tho CF seems to get the same results with >0 rather than >=0...

I'll add an IS NOT NULL appendage to my scripting and test it.

Thanks!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: May 13 '09

re: The trouble with Zero...


Did that solve the problem?
Member
 
Join Date: Mar 2007
Posts: 94
#5: May 13 '09

re: The trouble with Zero...


I haven't had time to test it yet, but I'll post what happens when I do.

(I'm in a 'jack of all trades' job that requires me to use CF intensively for about 2 weeks, then not touch it for 6 months or so, hence I forget quite a bit about it...)
Reply