Posted on Leave a comment

Query of queries reports runtime error

So are you pulling your hair out because your query of queries is returning an error "Query Of Queries runtime error."? The solution is rather simple. In your query that is feeding your QoQ, you probably have a column that is of datatype nchar. Cast that to a varchar and life will be good. Do the cast in the source query not the QoQ. eg. "CAST(foo AS varchar) AS bar" You’re welcome.

p.s. Yes, you can cast it to the same column name eg. "CAST(foo as varchar) AS bar" Case doesn’t matter.