SSRS: field shows correct in query but wrong in report preview
You must delete the filename.rdl.data in the project folder. This is a feature for SSDT. After deleting the rdl.data file, it will create a new one on the next viewing preview with the proper query and it will remove #ERROR.
Another possible way, that will make things easier in the future, is to create an external tool, just like described here:
Go to Tools > External Tools...
Add a new tool with the following settings:
- Title: Clear Report Data Cache
- Command: "%WinDir%\System32\cmd.exe"
- Arguments: /C DEL /S /Q "$(SolutionDir)*.rdl.data"
- Check options:
- Use Output window
- Close on exit
Now whenever you want to delete your report data cache, just go to Tools > Clear Report Data Cache.