Solved

How to read an output of the group by query in cold fusion.

Posted on 2004-08-12
6
260 Views
Last Modified: 2013-12-24
I am developing a report in cold fusion with ms access database.
and I want to run a query through a cold fusion page .
My query is
select source,count(id) from table_name group by source.
I don't know how to read the output of this query in cold fusion.

0
Comment
Question by:gaby22
  • 3
  • 3
6 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 11786877
<cfquery datasource="yourdsn" name="access_query">
SELECT Source, COUNT(ID) AS SourceCount FROM table_name GROUP BY Source
</cfquery>

<cfoutput query="access_query">
#Source# --> #SourceCount#<br>
</cfoutput>
0
 
LVL 4

Accepted Solution

by:
eclipse2k earned 500 total points
ID: 11786906
i guess, your problem is to get the count??? you should be able to give a name to the count variable.


Example 1)
select source,count(id) As 'sourcecount' from table_name group by source

Example 2)
select source,count(id) As sourcecount from table_name group by source


the only difference between example 1 and 2 is the ' around sourcecount, i am working with microsoft sql and there are both allowed, not sure with access, you should try it.


CF:

<cfoutput query="myquery">
 Source: #Source#, Occurance: #sourcecount# times
</cfoutput>



eclipse2k
0
 
LVL 4

Expert Comment

by:eclipse2k
ID: 11786930
hello mrichmon, just faster again..? i need more training.. :)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 35

Expert Comment

by:mrichmon
ID: 11787200
:o)

Happens all the time that two people post the same thing at almost the same time
0
 
LVL 4

Expert Comment

by:eclipse2k
ID: 11793952
hello mrichmon,

i dont understand why finally i got the accepted answer? sorry mrichmon...
you should be the one.

now i finally qualifed for the premium services for beeing one of the experts :) 10k points, finally :)

oh, i guest i should stop chit chatting in the Question Threads. Sorry, was the last one. Probaby :)
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 11794568
no problem - I don't care abou the points just about the user getting the answer.
Glad you got the premium services  :o)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now