How to use Custom Setting value as Column Name in SQL WHERE clause

bensch bensch asked Oct 19, 2016
Active Oct 19 · Viewed 2769 times
<p>Hi there, </p> <p>I'd like to reuse an xMod template by passing in a Custom Setting that contains the name of the SQL column I want to search for a value of "True". </p> <p>Where my setting is [[Module:DayName]] = adminDayMon <br> </p> <p>I want to use the SQL statement in my template of ... WHERE [[Module:DayName]] = 'True' ... <br><br>I have tried the above and no joy. Have also tried to create a parameter and then use the parameter in the SQL statement ... WHERE [@DayName] = 'True'... </p> <p>Again this fails. </p> <p>I am sure this should be possible but I am stumped as to how I can address this. </p> <p>Any thoughts on how to address this would be really welcome, </p> <p>THANKS!<br>Ben<br><br><br><br> </p>

7 Answers

Loading answers...