Jeff,
CF won't see ViewField6 as being from the query GetRecord. CF will see it
as a simple variable. This has to do with the concept of scoping of
variables. Check the online help for more information. To address the
field from the query, use:
<cfif GetRecord.ViewField6 is 0>
One other bit of advice is to not use ParameterExists(), as Allaire is
phasing out this function. Instead, use IsDefined(), as shown below.
Note one small difference in usage is that the variable name is passed in
quotes as the argument to IsDefined().
<cfif IsDefined("URL.RecordID")>
WHERE news.newsID = #URL.RecordID#
</cfif>
<cfif not IsDefinedExists("URL.RecordID")>
ORDER BY news.newsID DESC
</cfif>
Jim
-----Original Message-----
From: Jeff Fongemie <[EMAIL PROTECTED]>
To: Cf-Talk <[EMAIL PROTECTED]>
Date: Friday, June 30, 2000 7:52 PM
Subject: Why won't my <cfif> work with this??
>This looks so simple, am I missing something obvious? I can't get the
<cfif
>ViewField6 is 0> to work.
>
><CFQUERY name="GetRecord" dataSource="847_bib" maxRows=1>
> SELECT news.headline AS ViewField1, news.news AS ViewField2,
>news.date_entered AS ViewField3, news.blurb AS ViewField4, news.photo AS
>ViewField5, news.live, news.live AS ViewField6, news.newsID AS ID_Field
> FROM news
>
> <CFIF ParameterExists(URL.RecordID) IS "no">
> ORDER BY news.newsID DESC
> </CFIF>
>
>
> <CFIF ParameterExists(URL.RecordID)>
> WHERE news.newsID = #URL.RecordID#
> </CFIF>
></CFQUERY>
>
>
><HTML><HEAD>
> <TITLE>newswork - View Record</TITLE>
></HEAD><BODY bgcolor="ffffff">
><font size="+1"><img src="../images/control_01.gif" width="600"
>height="104"></font>
><br>
><font size="+2"><b><font face="Arial, Helvetica, sans-serif">View News
>Records</font></b></font>
>
>
><cfif ViewField6 is 0>
> <b><font size="2" face="Arial, Helvetica, sans-serif" color="red">THIS
>NEWS
> RECORD IS NOT LIVE</font></b>
> <cfelse>
> <font color="green"><b><font face="Arial, Helvetica, sans-serif"
>size="2">THIS
> NEWS RECORD IS LIVE</font></b></font>
></cfif>
>
>Jeff F.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.