Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Originally opened accounts
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01101049
Message ID:
01101056
Views:
13
Your question isn't clear because you didn't say wich fields tells when account was opended. Also, AFAIKS
iOpened = iTotal - iClosed
>
>I'd like to get statistics about accounts for particular batch. Some accounts were automatically closed on the day they were imported (could be various reasons - usually unsufficient balance).
>
>Bellow is my code:
>
>TEXT TO lcSQLStr TEXTMERGE noshow
>	SELECT ;
>	CAST(SUM(IIF(BETWEEN(tResolution_Date,##START_DATE##,##END_DATE##),1,0)) AS I) as iOriginally_Closed, ;
>	CAST(SUM(IIF(ISNULL(cResolution_Codes_Fk) ,0,1)) AS I) as iClosed, ;
>	CAST(SUM(IIF(ISNULL(cResolution_Codes_Fk),1,0)) AS I) as iOpened, ;
>	CAST(COUNT(*) AS I) as iTotal ;
>	FROM Trans WHERE iBatch_Number = <<m.tiBatch_Number>>	
>endtext
>lcSQLStr = STRTRAN(m.lcSQLStr, '##START_DATE##', m.lcStart_Date)
>lcSQLStr = STRTRAN(m.lcSQLStr, '##END_DATE##', m.lcEnd_Date)
>=RunSQL(m.lcSQLStr, 'c_BatchStatistics')
>
>E.g. I easily can get accounts closed on the particular day, but how can I get accounts opened on this day? Only Total - Closed?
>
>Any ideas?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform