By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

problems with dcount please help

P: n/a
Hello I am trying to create dcount field but is not working I have
tried every way possible and I can't get it to work. here is my code:

=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] between #01/01/2001# and " & [calldate])
I also tried:
=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] <= " & [calldate] the end result that I am
looking for in my report:

3/1/06 Calls: 10 contacts: 3 Scratched: 1 Cummulative: 1
3/2/06 Calls: 15 contacts: 4 Scratched:2 Cummulative: 3
Cummulative is the tricky part, and I am trying to do a dcount on that
field. Thanks for any help in advance.

Mar 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You put date delimiters around 1/1/2001, but not around [calldate].

=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] between #01/01/2001# and #" & [calldate] & "#")

If you don't use the US format for dates, you'll also need to format the
date to the US format. 1/1/2001 won't matter since the day and month are the
same, but for [calldate] it might make a difference. If you need it, that
would then be:

=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] between #01/01/2001# and #" & Format([calldate], "mm/dd/yyyy") &
"#")

--
Wayne Morgan
MS Access MVP
"Kaspa" <ka********@hotmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hello I am trying to create dcount field but is not working I have
tried every way possible and I can't get it to work. here is my code:

=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] between #01/01/2001# and " & [calldate])
I also tried:
=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] <= " & [calldate] the end result that I am
looking for in my report:

3/1/06 Calls: 10 contacts: 3 Scratched: 1 Cummulative: 1
3/2/06 Calls: 15 contacts: 4 Scratched:2 Cummulative: 3
Cummulative is the tricky part, and I am trying to do a dcount on that
field. Thanks for any help in advance.

Mar 21 '06 #2

P: n/a
Kaspa wrote:
Hello I am trying to create dcount field but is not working I have
tried every way possible and I can't get it to work. here is my code:

=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] between #01/01/2001# and " & [calldate])
I also tried:
=Dcount("[callid]","qryTotalscratched","[resultid] in (6,7,8,9) and
[calldate] <= " & [calldate] the end result that I am
looking for in my report:

3/1/06 Calls: 10 contacts: 3 Scratched: 1 Cummulative: 1
3/2/06 Calls: 15 contacts: 4 Scratched:2 Cummulative: 3
Cummulative is the tricky part, and I am trying to do a dcount on that
field. Thanks for any help in advance.


Kaspa,

[calldate] between #01/01/2001# and " & [calldate])

doesn't make much sense. Just a guess here, perhaps you want something
along the lines of:

SELECT Count(callid)
FROM qryTotalscratched
Where resultid in (6,7,8,9)
Group By calldate

If that doesn't help, perhaps you should describe in more detail what
you are trying to achieve.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Mar 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.