Counting the days sequentially in a month on a date field.

  • Thread starter BFish via AccessMonster.com
  • Start date
B

BFish via AccessMonster.com

I'm stuck and hopefully someone will give some needed help.

I have a totals query from a invoice table that totals the sale and the cost
of each record by day of the current month. By default of the invoice
production, non working dates are eliminated from the totals query. I am
trying to produce a query from that to sequential count the records, in other
words what working day of the month. I have used:

Date#: DCount("*","qryWorkDayTotal","[SumOfInvoiceSale]<=" &
[SumOfInvoiceSale])

Sucessfully, but it counts on the Sale field and not the date field. Trying
to count the records sequentially by date I substitute:

Date#: DCount("*","qryWorkDayTotal","[TotalOfDate]<=" & [TotalOfDate])

All that returns is zeros, [TotalOfDate] is a Date/Time field and looking at
other posts in forum looks like should not be a issue for this function.

qryWorkDayTotal is the current query I'm working with to add the counting
function and qryInvoiceTotalDate is the totals query for supplying totals and
reducing records to current month.

Can anyone help or have a suggestion on which way to go?

Thanks,
Bill
 
J

John Spencer

You need date delimiters in your expression.

Date#: DCount("*","qryWorkDayTotal","[TotalOfDate]<=#" & [TotalOfDate] & "#")
 
B

BFish via AccessMonster.com

John, I had tried the delimiters at one time but with your modified
expression working obviously I had something wrong in my application.

Thank you VERY MUCH!

Bill


John said:
You need date delimiters in your expression.

Date#: DCount("*","qryWorkDayTotal","[TotalOfDate]<=#" & [TotalOfDate] & "#")
I'm stuck and hopefully someone will give some needed help.
[quoted text clipped - 23 lines]
Thanks,
Bill
 

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

Top