if you need to know when outputting the query (as opposed to selecting the
data) then:

SELECT (columnValue % 2) AS isOdd
FROM table
WHERE whatever

Then you can use this when outputting...

<cfoutput query="myQuery">
        <cfif isOdd>
                do whatever
        </cfif>

                                                    
Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
                                                    


-----Original Message-----
From: David Baskin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 12, 2001 10:53 AM
To: CF-Talk
Subject: RE: Easy question I think:


Try this:

select *
from tblWhatever
where columnValue % 2 = 0

the % sign is the symbol for the modulus operator. it's the same as
division, but instead of the division value, it returns the remainder value.
If the remainder value is 0 then it's an even number.
HTH,

d

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 12, 2001 9:31 AM
To: CF-Talk
Subject: Easy question I think:


Can anyone give me a sql statement that tells me if a value is odd or even?

select * from table where ?????
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to