I have 2 queries.
The first one got an error message that it failed to convert date or time
select a.ProductID, sum(a.Quantity) as Qty ,SUM (a.SubTotal) as Sub
from TransactionDetail a join Transactions b on a.TransactionID = b.TransactionDate
group by productID
So I tried to convert date and time as follows
select a.ProductID, sum(a.Quantity) as Qty ,SUM (a.SubTotal) as Sub
from TransactionDetail a join Transactions b on a.TransactionID = (Convert(varchar(10),b.TransactionDate,101)) b.TransactionDate
group by productID
but now I got this error message:
Msg 102, Level 15, State 1, Line 3 Incorrect syntax near 'b'.