Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summing Billed and Collected
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01512706
Message ID:
01512770
Views:
57
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform