Skip to main content
Inspiring
February 3, 2008
Question

CFIF and dynamic variables

  • February 3, 2008
  • 4 replies
  • 950 views
I have SuperBowl brain or something this afternoon. I am trying to use a cfif statement with a dynamic variable and I am not writing correctly.

<CFIF getrecord.event#eventid# is "n"> where eventid is a dynamic variable from a loop and getrecord is the query that I am pulling from.

Help!

Thanks,
This topic has been closed for replies.

4 replies

hml398Author
Inspiring
February 3, 2008
I get the data from the getrecord query.

I am outputting a bunch of table cells from a query that picks all of the events. The eventid value comes from the matrix query that is being outputted for the table cells.

hml398Author
Inspiring
February 3, 2008
Actually the field is called event1, event2, event3, etc.

getrecord.event1, getrecord.event2
Inspiring
February 3, 2008
See sample.

Edit: fixed code sample
hml398Author
Inspiring
February 3, 2008
I get an error

Element EVENT is undefined in GETRECORD.
Inspiring
February 3, 2008
Try this.

<cfif getrecord.event[#eventid#] is "n">

If that doesn't work please specify the data type and content of n

Edited.
Inspiring
February 3, 2008
This may be better. I'm assuming event is a column name from a recordset and eventid if the row number of the row you want to examine.

<cfif getrecord["event"][#eventid#] eq "n">

Edit: attached code.