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 / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Results of 3 queries into 1?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
f2rox - 31 Jul 2006 16:14 GMT
I have queries for marketing purposes which keep track of how clients heard
about our company.  The query counts how many times each response (i.e.
internet, newspaper, etc.) occurs in a table of callers.  I have three
seperate queries; one returns the numbers for all calls, one returns numbers
from calls in the last three months (using the DateAdd function) and one
returns numbers from calls in the last month (again using the DateAdd
function).  Is there any way to view all 3 of these results in 1 query or 1
form?
Jeff Boyce - 31 Jul 2006 17:11 GMT
One approach might be to use a form and use the DLookup() function for three
controls (one for each of your current queries).  You could use DLookup()
against each query to get the "number".

Note that if there are no records that match your query's criteria, the
query returns nothing... you'll need to wrap an Nz() function around your
DLookup() function, to handle the nulls.

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I have queries for marketing purposes which keep track of how clients heard
> about our company.  The query counts how many times each response (i.e.
[quoted text clipped - 6 lines]
> 1
> form?
f2rox - 31 Jul 2006 17:32 GMT
I'm not really familiar with the DLookup () function.  Can you explain how i
would use that function in this case?
Thanks

> One approach might be to use a form and use the DLookup() function for three
> controls (one for each of your current queries).  You could use DLookup()
[quoted text clipped - 19 lines]
> > 1
> > form?
Jeff Boyce - 31 Jul 2006 19:18 GMT
You'd be better off spending time looking at Access HELP on the topic.  The
intricacies of the syntax may require you to "fiddle" with it a bit.
Examples are provided in HELP.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> I'm not really familiar with the DLookup () function.  Can you explain how
> i
[quoted text clipped - 28 lines]
>> > 1
>> > form?
Jade Skaggs - 31 Jul 2006 22:34 GMT
Will a UNION of the 3 queries not work??

> I have queries for marketing purposes which keep track of how clients heard
> about our company.  The query counts how many times each response (i.e.
[quoted text clipped - 4 lines]
> function).  Is there any way to view all 3 of these results in 1 query or 1
> form?
David F. Cox - 31 Jul 2006 23:55 GMT
something like a group query(off top of my head, and untested) :

all: 1
3month: iif([tdate] >= [startdate] and [tdate]<
dateadd("m",3,[startdate],1,0)
1month:iif(([tdate] >= [startdate] and [tdate]<
dateadd("m",1,[startdate],1,0)

SUM those three columns

David F. Cox

>I have queries for marketing purposes which keep track of how clients heard
> about our company.  The query counts how many times each response (i.e.
[quoted text clipped - 6 lines]
> 1
> form?
 
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.