Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output problem when multiple messages exists 1

Status
Not open for further replies.

ChiefJoseph

Programmer
Feb 16, 2001
44
0
0
US
I need to call apon the power of the cold fusion gods


Heres what i got,

<CFQUERY NAME=&quot;DateFindQuery&quot; DATASOURCE=&quot;Callender&quot; DBTYPE=&quot;ODBC&quot;>
SELECT MessageDay
FROM UserMessage
WHERE ((MessageMonth='#mo#' AND MessageDay='#count#' AND MessageYear='#year#'))
</CFQUERY>

<CFIF DateFindQuery.RecordCount greater than 0>
<td width='14%' height='70' bgcolor='#EEEEEE' align='right' valign='top'><font face='verdana,arial,helvetica' size=1><b>
<CFOUTPUT><a href=main.cfm?Year=#year#&Month=#mo#&Day=#count#></CFOUTPUT><font color=#FF0000>
**Here is the problem**

<CFOUTPUT QUERY=&quot;DateFindQuery&quot;>#count#


<CFIF #MessageDay# EQ #count#> <p><div align='center'><img src='reminder.gif' width='10' height='10'></div> </CFIF></CFOUTPUT>
</CFIF>

The goal of this is to check the database if there is a message for that day and display a warning. The problem is if there is more than one message for that day it shows my output that many times.
I've tried alot of things but nothing works.

Any Ideas?
 
HI
I think your problem might be with using <CFOUTPUT Query=&quot;DateFindQuery&quot;> This creates a loop which loops through every record in &quot;DateFindQuery&quot; this is going to cause a message for each record. I might not be understanding the full use of this but it looks like there should never be more then one message, so you might try

<CFOUTPUT>#DateFindQuery.count#
<CFIF #DateFindQuery.MessageDay# EQ #count#>
<p><div align='center'><img src='reminder.gif'
width='10' height='10'>
</div>
</CFIF>
</CFOUTPUT>
</CFIF>

I Cut that out of the part where you wrote
**Here is the problem**

That will only allow one repetition.
Hope it helps.

 
AHHHHH! I didn't know you could reference a query like this #DateFindQuery.MessageDay#

That solved everything, you rock!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top