When using sp_send_dbmail what is the correct syntax for the @query. My sql statment is not working. However when I comment that section out it performs fine. Here is my sample @query I think the issue is occurring where I have:
@query='SELECT * from food.LimsErrors WHERE [Column 0] = ''Yellow'''
What should the proper syntax be. I am guessing it is the number of apostrophes I have? Please advise.