Can someone please explain in english what creates the PMTTYPE field from the IF statement within the followin SELECT statement. I dont know SQL and appreciate all u brains out there!
"SELECT DISTINCTROW IIf(IsNull(MailinSource.MailinSourceID),"No Source Entered",Trim(Trim(Str([SourceNo])) & " " & [Description])) AS SourceDesc, MailinSource.Description, Val(Trim(Trim(Str([SourceNo])) & " " & [Description])) AS ValDesc, IIf([Prepaid],"Prepay",IIf([Receipts].[DowntownCash],"DCR",IIf([PaymentTypes].[PaymentType]="Cash","Cash",IIf([Receipts].[Mailin] And ([HeadOffice]=True),"Mail","Non")))) AS PmtType, Sum(([ReceiptsID]<=CLng(nz([RelatedReceipt],[ReceiptsID])))*-1) AS ReceiptCount, Sum(Receipts.ServiceCharge) AS SumOfServiceCharge, Receipts.MailinSourceID, Sum(IIf([DowntownCash],[AmountSubmitted],[TotalTax])) AS Expected, Locations.Location, Locations.LocationID"
2007-02-05
02:28:14
·
2 answers
·
asked by
justaguyaskingaquestion
1
in
Computers & Internet
➔ Programming & Design