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!

Basic CF Comparison Expression Question 1

Status
Not open for further replies.

rvancleef

Programmer
Apr 8, 2003
34
0
0
US
Hello,

I have some ASP background, but now am trying to work in Cold Fusion. From this query I am getting a recordset that contains the field .KeepPrivate

<cfquery name=&quot;student&quot; datasource=&quot;#request.mygordon#&quot;>
SELECT * FROM student WHERE id = '#gordon_id#'
</cfquery>

I then need to present the output to the end user based on the value of .KeepPrivate:

<cfif student.KeepPrivate contains the charactor 'Y'>
<td>N/A</td>
<cfelse>
<td>#student.HomeStreet1#</td>
<cfendif>

In ASP I would use &quot;If Instr(rs.KeepPrivate,'Y') Then&quot; but this is of course Cold Fusion. Any help would be tremendously appreciated!!!
 
I believe it would be:

<cfif student.KeepPrivate contains &quot;Y&quot;>
<td>N/A</td>
<cfelse>
<td>#student.HomeStreet1#</td>
</cfif>



Hope This Helps!

Ecobb
- I hate computers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top