Skip to main content
Known Participant
August 28, 2008
Question

Record count of dates selection

  • August 28, 2008
  • 3 replies
  • 462 views
Hi all

I am creating a meeting booking application and have a MySql table of available meeting dates.

These dates are placed in a form on a Cfm page for the responders to select the meeting they would like to attend. The results are in a second table of results. All of this is pretty straight forward stuff. Folk can then see who wants to attend each of the available meetings.

I have now been asked to give a summary of how many responders have selected each of the available dates.

I think that I am overcomplicating things so any advice on a simple way to go about this would be appreciated.

Can a MySql command do a record count of each date in the results table or will I have to loop through the meeting dates table to get each date from the results table and then do a select for each date and a record count of that.


I hope that makes sense. Any advice would be welcomed.

Thanks,

Paul.
This topic has been closed for replies.

3 replies

Inspiring
August 28, 2008
give it an alias.

if you want to learn sql, I have heard good things about the book, Teach Yourself SQL in 10 Minutes by Ben Forta.
Paul13Author
Known Participant
August 28, 2008
Thanks very much for that...

It works fine now,

Paul.
Paul13Author
Known Participant
August 28, 2008
Thanks for that I knew there should be some simple MySql. The thing now is how can I get cfm to display the results, I can easily display the output date variable, but the count of the date variable is a bit more tricky.

ie:

<table width="98%" border="0">
<tr>
<td><p><strong>Meeting Date:</strong></p></td>
<td><p><strong>Number of Atendant</strong></p></td>
</tr>
<cfoutput query = "attend">
<tr>
<td>#DateFormat (date, "dddd d mmmm yyyy")#</td>
<td><p>#count(attend_date)#</p></td>
</tr>
</cfoutput>
</table>

The <td><p>#count(attend_date)#</p></td> of course doesn't work.
Apologies if these are basic questions but I work alone here with no assistance to bounce ideas off.

Thanks,

Paul.
Inspiring
August 28, 2008
select date, count(date)
from your tables
where your conditons are met
group by date