Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complex accounting report for 'As of' date
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01375665
Message ID:
01375943
Views:
20
>>It's not really an accounting report, the report is called "synopsis". We got almost all numbers sum up fine except for one category which is a bit off and it's very hard to reconcile what fell into the cracks.
>
>What category?

Is there a way to get sum for accounts and not payments in this kind of the select statement

SELECT COUNT(distinct myField) as iAccounts, ;
SUM(IIF(ISNULL(dPosting_Date) AND iClosed = 1,1,0)) as iClosedNoPayments, ;
SUM(IIF(ISNULL(dPosting_Date) AND iClosed = 1,0,1)) as iClosedWithPayments, ;
SUM(IIF(ISNULL(dPosting_Date) AND iClosed = 0,1,0)) as iOpenNoPayments, ;
SUM(IIF(ISNULL(dPosting_Date) AND iClosed = 0,0,1)) as iOpenWithPayments,

Count distinct works, but I also want sum to be for accounts and not for payments.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform