I am trying to run a BAQ with this sql statement. When I run this in sql it works no problem. But when i run this and build it out in the BAQ it errors out. Any help with this would be greatly appreciated.
select
(datepart(year,POHeader.OrderDate)) as [Calculated_Year],
(count( POHeader.PONum )) as [Calculated_Count]
from Erp.POHeader as POHeader
where (POHeader.VendorNum = 9)
group by (datepart(year,POHeader.OrderDate))
The SQL is what is created in the BAQ. I ran it in sql just to check to see if it would work and I did not have any issues. I am not sure why it would give me some issues.