BAQ Incorrect Syntax

I’m getting an Incorrect syntax error near ‘.’ for the following BAQ. I’m pretty new to this and I’m having difficulty figuring out where to look.

[InvcHead].[InvoiceNum] as [InvcHead_InvoiceNum],
[InvcHead].[OrderNum] as [InvcHead_OrderNum],
[InvcHead].[PONum] as [InvcHead_PONum],
[InvcHead].[InvoiceDate] as [InvcHead_InvoiceDate],
[InvcHead].[DueDate] as [InvcHead_DueDate],
[InvcHead].[InvoiceAmt] as [InvcHead_InvoiceAmt],
[InvcHead].[InvoiceBal] as [InvcHead_InvoiceBal],
[InvcHead].[SalesRepList] as [InvcHead_SalesRepList],
[Customer].[Name] as [Customer_Name],
[OrderHed].[ShortChar01] as [OrderHed_ShortChar01],
[OrderHed].[ShortChar02] as [OrderHed_ShortChar02],
[Customer].[CustID] as [Customer_CustID],
[Memo].[MemoDate] as [Memo_MemoDate],
[Memo].[MemoUserID] as [Memo_MemoUserID],
[Memo].[MemoDesc] as [Memo_MemoDesc],
[Memo].[MemoText] as [Memo_MemoText],
(@Today InvcHead.DueDate) as [Calculated_DaysLate],
[Customer].[Number01] as [Customer_Number01]
from Erp.InvcHead as InvcHead
inner join Erp.Customer as Customer on
InvcHead.Company = Customer.Company
and InvcHead.CustNum = Customer.CustNum
left outer join Erp.OrderHed as OrderHed on
InvcHead.Company = OrderHed.Company
and InvcHead.OrderNum = OrderHed.OrderNum
left outer join Ice.Memo as Memo on
InvcHead.Company = Memo.Company
and CAST( InvcHead.InvoiceNum as nvarchar(50)) = Memo.Key1
where (InvcHead.OpenInvoice = 1)

Thank you for any help provided!

I usually get this similar error when I did not setup my calculated field correctly. e.g.


Instead of the avobe, try this:
datediff(day, InvcHead.DueDate, getdate() )

Refer to SQL Server for more information on DateDiff

This worked. Thank you!