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

x
?
Solved

simple recordcount for output query

Posted on 2003-11-24
1
Medium Priority
?
191 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
[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
1 Comment
 
LVL 10

Accepted Solution

by:
Mause earned 300 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

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…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
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…

721 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