Nothing too complicated here, but I've struck a small issue. Basically, I want to offer two views for a calendar based upon a database query (which contains every day of the month, whether there's data or not).
Display one is pretty typical... <cfoutput query="eventsCalendar"> <cfif Len(Title)> <h4>#Title#</h4> <div style="padding-left: 25px"> Starts: #DateFormat(start_date, "mmmm d, yyyy")#- <strong>#start_time#</strong><br /> Contact: #Contact_phone# <cfif Len(Contact_email)>Email: <a href="mailto:#Contact_email#">#Contact_email#</a><br /></cfif><br /> </div> </cfif> </cfoutput> No problems there, but now I also want to put every date in a table cell and list events (occurring on that day) in that cell... <table id="calendar"> <tr> <cfset cellcount = 1 /> <cfoutput query="eventsCalendar" group="start_date"> <td>#DateFormat(start_date, "mmmm d, yyyy")#<br /> <cfoutput> <cfif cellcount EQ 4> </td></tr><tr"> <cfset cellcount = 1> <cfelse> #Title# <cfset cellcount = #cellcount# + 1 /> <cfif Len(Title) EQ 0></td></cfif> </cfif> </cfoutput> </cfoutput> </tr> </table> This is close, but not quite right. My problem occurs when there is more than one event on a particular date. I used the <cfif Len(Title) EQ 0></td></cfif> to detect whether or not there are more events on a given date (based upon start_date in the group attribute), and if not to close the cell. I believe this is where I am going astray, because it still adds one to cellcount even if this is not the LAST entry on the date. In turn this means the row is closed one cell too early (or two, or three, depending on the number of entries/events on a given date). So, what I need to do is detect when the last entry on a given date is, close the cell and only THEN add 1 to cellcount (as opposed to adding one to cellcount each time it finds a valid entry, even before closing the cell). And moving the cfset, like so <cfif Len(Title) EQ 0></td><cfset cellcount = #cellcount# + 1 /></cfif> just plays havoc with all empty entries from the database, obviously. I'm not sure how to accomplish this just yet. Any ideas?? TIA Mark ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202318 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

