This is the table structure I'm trying to query:
Storename varchar 50
Bussinessdate datetime 8
txnnumber text 16
subtotal float 8
discounts float 8
paidamount float 8
transactiontype text 16
time datetime 8
This is my query which results to " The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator."
select Storename, sum(Subtotal - Discounts) as gross,
Transactiontype, datepart(weekday, Time) as DWeekday,
datepart(hour, Time) as DHour, count(txnnumber) as tcount
from tMas_TxnSummary
where Bussinessdate >= '01/01/2008' and Bussinessdate <= '01/31/2008'
and Storename = 'Sample'
group by Storename,Transactiontype, datepart(hour, Time),datepart(weekday, Time);