I'm trying to query how many transaction each loyaltyID
column has in AnthemTxns_Jr and what the total of all of their transactions adds up to. Right now, when I run this script, it says,
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.AnthemTxns_JR.count", or the name is ambiguous
Code:
Select DISTINCT
dbo.ANTHEM_IDS_JR.loyaltyID,
dbo.ANTHEM_IDS_JR.Military_Type,,
dbo.ANTHEM_IDS_JR.Military_Date,
dbo.AnthemTxns_JR.count(CheckTotal),
dbo.AnthemTxns_JR.sum(CheckTotal)
From
dbo.ANTHEM_IDS_JR
JOIN
dbo.AnthemTxns_JR ON dbo.ANTHEM_IDS_JR.loyaltyID = dbo.AnthemTxns_JR.loyaltyID
WHERE
Military_Type = 'Active Duty'
AND ACTIVE = 1
AND datalength(dbo.ANTHEM_IDS_JR.Military_Date) > 0
ORDER BY
loyaltyID;