Date()

B

Benjamin

Hi,

only a little question.Is it possible to replace the
Date() function with an function that compares all dates
so that only datasets of the last year (365 days) are
summed up to that field. for the next dataset this
procedure must be restartet. the dataset is Date an
quantity.

Is that anyhow possible ?

Thanks for helping

With best regards

Benjamin Schmid

DSum(("Stückzahl", "TableNameHere", "Date( ) - DatumField
<= 365
" )
 
M

Michel Walsh

Hi,


If I understand the question, you want to sum all the amounts in the
table, between the date supplied in the field and that date, less 365?

DSum(("Stückzahl", "TableNameHere", "DatumField-" &
Format(DatumField , "\#mm-dd-yyyy\#") & " BETWEEN -365 AND 0
" )



So, assume that, for a particular record having to compute the expression,
has, for DatumField, today date. The third argument of DSum will become,
under those conditions:

" DatumField - #08-26-2004# BETWEEN -365 AND 0 "


So, DSUM will compute, sum, the amounts for all the records satisfying that
condition, so, for all records having their DatumField value between the
27th of August 2003 and the 26th of August 2004.

Since each record will supply its own value, for DatumField, in the format
of the string making the third argument, so each record will get the sum
over the 365 past days, these days being define relatively to the date of
the record, in its field DatumField.



Hoping it may help,
Vanderghast, Access MVP



Hi,

only a little question.Is it possible to replace the
Date() function with an function that compares all dates
so that only datasets of the last year (365 days) are
summed up to that field. for the next dataset this
procedure must be restartet. the dataset is Date an
quantity.

Is that anyhow possible ?

Thanks for helping

With best regards

Benjamin Schmid

DSum(("Stückzahl", "TableNameHere", "Date( ) - DatumField
<= 365
" )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Zdouble Problem 1
Missing Operator Problem 4
DSum criteria 1
calculating 30 year daily average 2
Date Comparison 2
Help with julian date? 2
grouping up date data 1
Formula in bound box 1

Top