Solved

simple recordcount for output query

Posted on 2003-11-24
1
175 Views
Last Modified: 2013-12-24
can't get this:  each of the following timeslots repeats 15 times but i'm only showing 1.  how can i show the record count for each unique repeating timeslot

eg:

February 6, 2004  8:30 AM (15 timeslots remain)
February 6, 2004  1:30 PM 6 (15 timeslots remain)

February 7, 2004  8:30 AM 6 (15 timeslots remain)

February 7, 2004  1:30 PM 6 (15 timeslots remain)

February 16, 2004  8:30 AM 6 (15 timeslots remain)

February 16, 2004  1:30 PM 6 (15 timeslots remain)


here's my code:

<cfquery name="rsTimes" datasource=#MM_connCalArts_DSN# username=#MM_connCalArts_USERNAME# password=#MM_connCalArts_PASSWORD#>
SELECT  timeslots_theater.timeslots, mix_theater.cities_id, cities_theater.cities,
mix_theater.timeslots_id, mix_theater.mix_id, timeslots_theater.id FROM timeslots_theater,
mix_theater, cities_theater WHERE timeslots_theater.id = mix_theater.timeslots_id
AND cities_theater.id = mix_theater.cities_id AND cities_id = '#rsTimes__MMColParam#'
group by timeslots
order by timeslots asc
</cfquery>

>>>>>>>>>>>>>>>>>>>>>>>>>>>

<cfoutput query="rsTimes" group="timeslots">
    <li><A HREF="application.cfm?#Trim(MM_keepURL & Iif(MM_keepURL NEQ '',DE('&'),DE('')) & 'mix_id=' & rsTimes.mix_id)#" class="craig">#dateformat(rsTimes.timeslots, 'mmmm d, yyyy')#&nbsp; #timeformat(rsTimes.timeslots, 'h:MM tt')#</A>
  </cfoutput>
0
Comment
Question by:phillystyle123
1 Comment
 
LVL 10

Accepted Solution

by:
Mause earned 75 total points
ID: 9810036
Try this:

<cfquery name="rsTimes" datasource=#MM_connCalArts_DSN# username=#MM_connCalArts_USERNAME# password=#MM_connCalArts_PASSWORD#>
      SELECT  count(*) as slotsremain,
                  timeslots_theater.timeslots,
                  mix_theater.cities_id,
                  cities_theater.cities,
                  mix_theater.timeslots_id,
                  mix_theater.mix_id,
                  timeslots_theater.id
      FROM      timeslots_theater, mix_theater, cities_theater
      WHERE      timeslots_theater.id = mix_theater.timeslots_id
      AND       cities_theater.id = mix_theater.cities_id
      AND       cities_id = '#rsTimes__MMColParam#'
      group by timeslots
      order by timeslots asc
</cfquery>

You can use #slotsremain# in your query-loop for the remaining slots!

let me know
Mause
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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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