Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

DCount Difficulty

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rod - 29 Aug 2005 16:34 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.