Calculation based upon date

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hello,

I have a form used to enter data into a table. On the
form, there is a textbox located in the footer of the
form called "TotalGross". It displays a sum of all
the "GrossRevenue" fields in the table. Also in the
footer, I have textboxes called "January", "February",
etc. for each month that I would like to display the
Revenue for that particular month. There is
a "DateDelivered" field in the table and also on the
form. Right now the textboxes for each month
display "$0.00" while the "TotalGross" box displays the
sum of all the "Gross Revenue" fields, which is what it
should display. Below is my code for the Monthly
Textboxes. I used January as an example. Where is my code
wrong?

=Sum([Gross Revenue]) Between #1/1/2004# And #1/31/2004#

I have tried many variations of the symbols around the
dates and I still get $0.00 in the fields. Some
variations produce an "#Error" message in both the
Monthly and TotalGross textboxes. Any help would be
greatly appreciated.
 
Not sure of exactly how to fix it, but how does that code tell Access which
field should be between the dates entered? I would think you would need to
have a WHERE clause that said something like...

Where [DateDelivered] Between #1/1/2004# And #1/31/2004#

Not a complete answer, but Hope that helps..

Rick B
 
Back
Top