I run into a strange problem when I tried to create a report off of SQL stored procedure. I thought one of you may encounter similar problem, so here it is and the solution to it.
Basically, I had to dynamically define a table that I will be pulling data from. For that purpose I have defined a variable called @table and then used a statement "EXEC "select * from "+@table+"" to retrieve data from this table.
That worked out ok in Query Analyzer, but would not work in Crystal which returned the error message "Incorrect syntax by the keyword 'from'". The solution: Once I have made @table to be a char variable instead of varchar it worked fine.
Basically, I had to dynamically define a table that I will be pulling data from. For that purpose I have defined a variable called @table and then used a statement "EXEC "select * from "+@table+"" to retrieve data from this table.
That worked out ok in Query Analyzer, but would not work in Crystal which returned the error message "Incorrect syntax by the keyword 'from'". The solution: Once I have made @table to be a char variable instead of varchar it worked fine.