Date()

  • Thread starter Thread starter Benjamin
  • Start date Start 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
" )
 
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
" )
 
Back
Top