SELECT objtransaction.siteid,sitename,count(objtransaction.siteid)as total_transaction
FROM AssoLogicalPhysicalEquipment RIGHT OUTER JOIN ObjCSCCard RIGHT OUTER JOIN ObjSite
INNER JOIN ObjTransaction ON ObjSite.SiteID = ObjTransaction.SiteID ON ObjCSCCard.TicketPhysicalID = ObjTransaction.TicketPhysicalID
LEFT OUTER JOIN RefMessageType ON ObjTransaction.MessageTypeValue = RefMessageType.MessageTypeValue
LEFT OUTER JOIN ObjEquipment ON ObjTransaction.EquipmentID = ObjEquipment.EquipmentID ON AssoLogicalPhysicalEquipment.EquipmentID = ObjEquipment.EquipmentID
LEFT OUTER JOIN ObjLogicalEquipment ON AssoLogicalPhysicalEquipment.LogicalEquipmentID = ObjLogicalEquipment.InternalID
WHERE businessday>='2011-03-01'and businessday<='2011-03-31' and machinename like 'tom%' and objtransaction.siteid<>'0'
group by objtransaction.siteid,sitename
order by 1,3 desc
แล้วผมต้องการCount (objtransaction.siteid) ข้อมูลใน crystal reports ไม่รู้ว่าต้องเขียนยังไงใน Formula Fieldsครับ
ขอผู้รู้ช่วยแนะด้วยครับ
Tag : .NET, Ms SQL Server 2005, Crystal Report, Win (Windows App), VB.NET