What am I doing wrong here? I am getting this error on:
SELECT LEFT(SUBSTRING(batchinfo.datapath, PATINDEX(\'%[0-9][0-9][0-9]%\', batchinfo.datapath), 8000),
I just found this error., while using GETDATE() [i.e outer reference] in the group by clause in a select query.
When replaced it with date column from the respective table it cleared.
Thought to share as a simple example. cheers ;)