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
Solved

simple recordcount for output query

Posted on 2003-11-24
1
179 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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