Well, let says that you want to get a count of everything in
your ITEMS table that has a QUANTITY of at least 3 and a PRICE of
greater than $5.00 (assuming that QUANTITY and PRICE and columns
within the ITEM table)
A real simple way of handling this app would be to first do
the query and then out put the result. Your entire application
would be:
<cfquery name="qGetItemCount"
datasource="datasourceName">
SELECT Count(*) AS itemCount
FROM items
WHERE quantity >= 3
AND price > 5
</cfquery>
<cfoutput>#qGetItemCount.itemCount#</cfoutput>
And that is it. It only gets more complicated from there, and
you need to strongly consider some learning resources if you want
to excel at ColdFusion. It is an easy language to learn and use,
but, like any other language, it should not be fuddled through.
Note: You'll need to get your datasourceName from your
administrator.