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?