I am trying to select a specific column from a database, however the column name is unknown. The columns range from FullTime_01_D to FullTime_95_D. The only thing that changes is obviously the numbers in the middle, which I can find out with no problem.
I've set up a query like so:
Note: #FTDeduction# is the the string "FullTime_" & #PayType# & "_D". Paytype determines the number in the middle.
I can output #query# and see that my query is right. However, how can I reference the column that is dynamically created as well as the result from the cfquery hmocost? In other words, I can't output the result- which is just a dollar amount.
Any help is appreciated. Thanks.
I've set up a query like so:
Code:
<CFSET query="SELECT " & #FTDeduction# & " FROM Rates_New WHERE Rates_New.ID = 1>
<cfquery name="HMOCost" datasource="MCSD">
#query#
</cfquery>
Note: #FTDeduction# is the the string "FullTime_" & #PayType# & "_D". Paytype determines the number in the middle.
I can output #query# and see that my query is right. However, how can I reference the column that is dynamically created as well as the result from the cfquery hmocost? In other words, I can't output the result- which is just a dollar amount.
Any help is appreciated. Thanks.