crystal reports formula field Good day, I am making a sales report on Crystal Report - VS2010 c#
I have this view in MS SQL
vSales
OrderNo
OrderDate
Amount
PaymentType
Payment type can either be Cash or Check I performed select all because I need both in the same report
so how do I get the sum of Amount where PaymentType is equal to cash?
I used Sum for my total Amount, both check and cash, in the formula workshop
Sum ({vDailySales.Amount})
I can't modify my SELECT statement because I need all the record with cash & check payment
Create two formulas - CashAmount and CheckAmount, for example second one:
if {vDailySales.PaymentType}="cheque"
then {vDailySales.Amount}
else 0
On report, use aggregates of said formulas - like Sum({@CashAmount}).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With