This content has been marked as final. Show 6 replies
Yes you can use session variables.
<cfquery name="getUser" datasource="test">
SELECT Col1, Col2, Col3
WHERE Col3 = #Session.variable#
I don't think that's exactly what they're trying to do. But if you read the other thread .. you can see what was suggested so far.
I think you want to do this, if the value in the session variable is the actual column name:
<cfquery name="rsSelectColumn" datasource="Test">
SELECT Column 1, Column 2, #Session Variable# AS Col3
this way you can call any column stored in the session variable, and it will always be usable from the QUERY as COL3 regardless of what column you used.
If that is what you want to do - it IS that simple.
Sometimes we over think things too much.
> SELECT Column 1, Column 2, #Session Variable#
That's what I already suggested on the other thread
Did anyone read the comments on this thread? :-)
Thanks! Works like a charm.