Custom Query Repeater Helper Macro Not Working

lawrence whittemore asked on May 10, 2017 15:32

Hello, I have a custom query repeater with this as the query

Select * 
From MMH_EmployeeTracker
##WHERE##

In the control I have the where condition set to Where UserName = '70'

I get this error in the error log "Message: An invalid SQL query was used."

If I remove the ##WHERE## and replace it with the "Where UserName = '70'" i have for the where condition it works just fine. however, I need actually get my user id with a macro and need to use the macro helper.

any thoughts?

Correct Answer

Trevor Fayas answered on May 10, 2017 15:49

You just have some slightly wrong syntax.

SELECT ##TOPN## ##COLUMNS## from MMH_EmployeeTracker WHERE ##WHERE## ORDER BY ##ORDERBY##

If you do not pass a where condition, it puts "1=1" for the where condition. Then change your where to just "Username = '70'"

2 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.