• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

cfif for skipping

I have;
<cfquery name="GetClient" datasource="...........>
select Firstname, lastname, ........
from Clients C, RideAppt R
where C.ClientID = R.ClientID
.....
</cfquery>

On the display,

<cfoutput query="GetClient">
<p>
<div align="center">
  <p><img src="bar.gif" width="500" height="9" alt="" border="0"></p>
    <table border="1" align="center" width="100%">
...........

    </table>
 </div>

What I want is to skip   <p><img src="bar.gif" width="500" height="9" alt="" border="0"></p> if Firstname and lastname are the same.

Thanks.



0
JohnLucania
Asked:
JohnLucania
  • 2
  • 2
1 Solution
 
tim_csCommented:
Try adding this

<cfif firstName NEQ lastName><p><img src="bar.gif" width="500" height="9" alt="" border="0"></p>
<cfelse></cfif>
0
 
JohnLucaniaAuthor Commented:
Oh!  I meant if the previous record and the next record are for the same person.

For instance,

John Doe.............
John Doe............
.............bar.gif............
Sue Doe
.............bar.gif............
0
 
tim_csCommented:
Maybe this will work for you??

<cfset prevFirstName = "">
<cfset prevLastName = "">

<cfoutput query="GetClient">
<p>
<div align="center">
<cfif prevFirstName NEQ firstName AND prevLastName NEQ lastName>
  <p><img src="bar.gif" width="500" height="9" alt="" border="0"></p>
</cfif>
    <table border="1" align="center" width="100%">
...........

    </table>
 </div>
<cfset prevFirstName = firstName>
<cfset prevLastName = firstName>
</cfoutput>
0
 
JohnLucaniaAuthor Commented:
Great.  That works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now