• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFIF and dynamic variables

Explorer ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

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,
TOPICS
Advanced techniques

Views

861

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

Try this.

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

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

Edited.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

I get an error

Element EVENT is undefined in GETRECORD.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

Actually the field is called event1, event2, event3, etc.

getrecord.event1, getrecord.event2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

See sample.

Edit: fixed code sample

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: hml398
Actually the field is called event1, event2, event3, etc.

getrecord.event1, getrecord.event2

Normalize your database and you won't have problems like this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 03, 2008 Feb 03, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation