2 Replies Latest reply on Oct 5, 2007 12:11 PM by Matthew@certifiedwebpro

    How to Output All Rows but Dynamically Limit Columns?

    Matthew@certifiedwebpro
      Hi Everyone:

      I am pretty new to Coldfusion and I'm stuck on how to do a specific kind of search in Coldfusion.

      Here is the basics:

      1. I am working with one table (called COURSES).
      2. Within that table are several columns. Here is what my boss wants.
      -He wants all of the courses to always be output.
      -He wants ONLY the columns that are checkmarked (using checkmark boxes) to be outputed.

      3. I was thinking that I need to use
      <cfif> statements to produce some form of dynamic sql that would output all of the courses, but only the columns the enduser wants to view.

      I'm not sure how to do that (I've tried for a day now).

      Here are the columns in the table that are important:

      <cfquery name="rsCOURSES" datasource="SCHEDULING_TRACKER">
      SELECT COURSE_NAME, MT_ID, DOCUMENTATION_DATE, PRESENTATION_FILES_DATE, JOB_AIDS_DATE
      FROM dbo.COURSES
      ORDER BY COURSE_NAME ASC
      </cfquery>

      One of the issues (is it an issue?) is that 3 of the above are date columns. The check boxes are just to determine whether those columns should be displayed.
      I am exporting to an excel file (which I think I figured out ok).

      Thanks for any help.
      Matthew