Well some time back I wrote a blog regarding Dynamic SOQL. You can have a look on thisabout http://blogforce9.blogspot.in/2012/09/using-variables-in-dynamic-soql.htmlUsing Variables In Dynamic SOQL, including the limitation that you cannot use dot notation in the referenced variables.
format link, mention that blog post describes the same problem reported in this question
tomlogic
- 4.5k
- 2
- 33
- 58