macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: problem using DISTINCT

Subject: Re: problem using DISTINCT
From: "cf_dev2"
Date: Fri, 17 Aug 2007 18:11:26 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
Yes, I think that's the problem.  I just read an article stating that 
internally Access stores yes/no values as [b]-1[/b] (yes) and 0 (no), instead 
of 1 and 0.  So MAX(wh_standard) is returning 0  (not standard) because 0 is 
greater than -1.  

 One option is to use Access'  IIF function to tweak the values




 <cfquery name="getstroke" datasource="AccessDSN">
 SELECT         max_stroke_mm, MAX( IIF(wh_standard, 1, 0)) AS ItIsStandard
 FROM   presses
 WHERE  model_head LIKE '#headmodel#%'
 GROUP BY max_stroke_mm
 ORDER BY max_stroke_mm
 </cfquery>

    <select style="padding:0px;margin:0px;" name="max_stroke_mm">
       <cfoutput query="getstroke">
       <option value="#max_stroke_mm#"> #max_stroke_mm# mm <cfif 
itIsStandard>(standard)</cfif></option>
        </cfoutput>
 </select>


<Prev in Thread] Current Thread [Next in Thread>