Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing Billed and Collected
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
Database:
Visual FoxPro
Divers
Thread ID:
01512706
Message ID:
01512770
Vues:
58
>I just tried out the DATE() function. I never knew you could use parameters with it. I always used it as DATE().
>Thanks,
>Cecil
>
>>If you want to use different dates in the sums, use an IIF() expression as what to sum, something like:
>
>>SUM(IIF(BETWEEN(bill_date, DATE(2010,1,1), DATE(2010,1,31)), bill_prem, 0)
>
>>I also changed your CTOD() to use DATE(), which is much safer.
>
>>Tamar


An interesting fact about date() (and datetime()) is that any of the parameters can be null, which will result in the current date/time value, for example:
? DATE(YEAR(DATE()) - 1, null, null) &&  same day last year
? DATETIME(null, null, null, 16, 0, 0) && Today at 4 PM

etc.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform