console.log(this.props)
答案 0 :(得分:0)
select
l.LocationName, l.LocationPrefixCode,
sum(case when lt.transid=1 then lt.Points else 0 end) as TotalEarnpoints,
sum(case when lt.transid=2 then lt.points else 0 end) as TotalRedeempoints,
sum(case when lt.transid=1 then 1 else 0 end) as NoOfBillsEarned,
sum(case when lt.transid=2 then 1 else 0 end) as NoOfBillsRedeemed
from
InvLoyaltyTransaction lt
inner join
dbo.Location l ON lt.LocationID = l.LocationID
where
cast(DocumentDate as date) between convert(date, '" + fromDate + "', 103)
and convert(date, '" + toDate + "', 103)
and CardType in (select CardMasterID
from CrmReportCondition)
and lt.LocationID != 1
group by
l.LocationName, l.LocationPrefixCode
order by
l.LocationName