473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Advance query/report question

Hi everyone,

This is a tough one. I have a database full of solicitations,
identifying a customer and recording initial call, first followup,
second followup, etc.

My boss want to be able to generate a report showing a list of
customer who were call between two different dates that he types into
a form. That, I have done. My boss types in his two dates, the SQL
statement searches through the follow-up call fields for a date
between those two dates and prints that record out in the report when
it finds one.

Here's the tough part.

In a new column of the report, my boss wants the date of that call.

You see the difficulty. First I have to gather a set of data
containing dates within a dynamically specified range. Then from that
range I populate a new column with the particular date that satisfied
that test.

I though I was on the right track with the following obscenely bloated
IIF statement:

=IIf( not IsNull([Followup_4th]), [Followup_4th],=IIf( not
IsNull([Followup_3rd]), [Followup_3rd],=IIf( not
IsNull([Followup_2nd]), [Followup_2nd],=IIf( not
IsNull([Followup_1st]), [Followup_1st], [Initial_Call]))))

By making this statment the controlsource of a query field, I was able
to populate a column with the date of the LATEST contact made with
each customer. If there was a way that I could dynamically limit the
above IIF to a range of dates I would have my answer. But I can't
figure out how to change the control source of an individual query
field dyanamically, and I can't figure out out to successfully
introduce variables into an IIF statement.

Any Ideas?
Nov 13 '05 #1
1 1651
Mike Cooper wrote:
Hi everyone,

This is a tough one. I have a database full of solicitations,
identifying a customer and recording initial call, first followup,
second followup, etc.

My boss want to be able to generate a report showing a list of
customer who were call between two different dates that he types into
a form. That, I have done. My boss types in his two dates, the SQL
statement searches through the follow-up call fields for a date
between those two dates and prints that record out in the report when
it finds one.

Here's the tough part.

In a new column of the report, my boss wants the date of that call.

You see the difficulty. First I have to gather a set of data
containing dates within a dynamically specified range. Then from that
range I populate a new column with the particular date that satisfied
that test.

I though I was on the right track with the following obscenely bloated
IIF statement:

=IIf( not IsNull([Followup_4th]), [Followup_4th],=IIf( not
IsNull([Followup_3rd]), [Followup_3rd],=IIf( not
IsNull([Followup_2nd]), [Followup_2nd],=IIf( not
IsNull([Followup_1st]), [Followup_1st], [Initial_Call]))))

By making this statment the controlsource of a query field, I was able
to populate a column with the date of the LATEST contact made with
each customer. If there was a way that I could dynamically limit the
above IIF to a range of dates I would have my answer. But I can't
figure out how to change the control source of an individual query
field dyanamically, and I can't figure out out to successfully
introduce variables into an IIF statement.

Any Ideas?


I would create a query that "groups by" between the two dates. Next,
I'd create a query that selects records between the two dates. And I
would then create a report/sub-report.

If you are using a flat file method...which it appears you are doing
from above...heck...write a function that passes your followup dates and
the date range and return a string of the dates that met the criteria.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David | last post by:
This might be a report question but I think it is more a query issue than a report. I am a novice at bothAccess reporting and queries and have been struggling to build the following. (Note using...
2
by: Erica | last post by:
Hi All, I've searched the usenet/web high and low and cant seem to find any guidelines for the query i'm trying to write. I have made a database that contains all my invoices. Invoices that...
2
by: Keith C. Perry | last post by:
Ok, I've tried a number of things here and I know I'm missing something but at this point my head is spinning (i.e. lack of sleep, too much coffee, etc...) My environment is PG 7.4.3 on Linux...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
2
by: mgolding | last post by:
I have an Access query that gets an ID value from an open form. Something like SELECT * from tablename WHERE ID=openFormName.ID; But now, I want to also run the query by handing it the ID from...
5
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
22
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
3
by: Richard Hollenbeck | last post by:
I am very sorry about the (almost) re-post, but you will see that my first question wasn't very clear; I have another question I posted this morning called, "in DAO: Run time error 3061 Too few...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.