• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • 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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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