Hello,
I need to do the following:
1) Count all of the [CALL_ON] = today's date.
2) Separately count [CALL_ON] = today's date AND ([CALL_RESULTS] = "Message"
or ([CALL_RESULTS] = "CO"
3) Add "/" to the end.
#1 above works fine. My issue is with #2 above; I have not been able to
figure out how to do the AND in the above. Here is what the code looks like
so far, but it does not work:
Me.tbxResume_SF = Nz(DCount(Format(Date, "\#mm\/dd\/yyyy\#"),
"tblCandidates", "[CALLED_ON] = " & Format(Date, "\#mm\/dd\/yyyy\#") & " And
([CALL_RESULTS] = 'Message' or [CALL_RESULTS] = 'Corp Overview')"), 0) & "/"
Thanks.
Carl Rapson - 30 Aug 2005 15:25 GMT
When you say it 'does not work', what do you mean? Are you getting an error
message, or is the statement executing but you're not getting what you
expect? What is returned from the DCount?
As a quick note, if you are wanting a count of records, the first parameter
in DCount can be "*" rather than a specific field.
Carl Rapson
> Hello,
>
[quoted text clipped - 17 lines]
>
> Thanks.
Rod - 30 Aug 2005 19:34 GMT
The first DCount returned: 0. The statement is executing, but I am not
getting what I want/expect
> When you say it 'does not work', what do you mean? Are you getting an error
> message, or is the statement executing but you're not getting what you
[quoted text clipped - 26 lines]
> >
> > Thanks.
Carl Rapson - 31 Aug 2005 15:52 GMT
When you say that "Count all of the [CALL_ON] = today's date" works, does
that mean this:
DCount(Format(Date, "\#mm\/dd\/yyyy\#"), "tblCandidates", "[CALL_ON] = " &
Format(Date, "\#mm\/dd\/yyyy\#"))
returns a number other than zero? I can't spot anything wrong with the AND
clause, so are you absolutely certain that there are records where
[CALL_DATE]=today and [CALL_RESULTS]='Message' or 'Corp Overview'? Can you
enter the SQL as a SELECT statement (instead of DCount) in the Query builder
and get what you want?
Carl
> The first DCount returned: 0. The statement is executing, but I am not
> getting what I want/expect
[quoted text clipped - 34 lines]
>> >
>> > Thanks.