Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Complex accounting report for 'As of' date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01375665
Message ID:
01376191
Vues:
28
>Hi Naomi
>
>Firstly congratulations for the award this year too and I see you have it all 3 categories, you earned it. Thanks for the help you have given me too.
>
>>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,
>
>I know you have this resolved so that is great, but I can't resist the comment, you are only SUM()ming NULLs above, how about the non-NULL records and could a GROUP BY on account help you with the query.

Thanks again. A bit tired today, but I could not figure out how to properly sum accounts and not payments. If you group by Account Number, would it still work? I guess it would, don't know why I didn't try when I was looking at this statement today...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform