Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-12
6
Medium Priority
?
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

 
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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

704 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