David Fenton
dfenton at ozemail.com.au
Sun Jun 29 06:18:41 CDT 2003
Hello Gustav,
Thanks for your advice. Another list member sent me some advice on
subqueries which I will use later. The Dlookup suggestion gave me an idea
and I ended up solving it by doing a DSum directly to QUERY A, since that
was the purpose of combining them - it summed the results of one field from
Query A. The DSum worked perfectly...
TotalHolidayWeeks = DSum("Weeks", "qryMyFirstQuery", strWhere)
and I used
strWhere = "tblCourseHolidays.CampusID= CampusID) AND
((tblCourseHolidays.StartDate)> #StartDate#) AND
((tblCourseHolidays.EndDate)<#EndDate#));
I was then able to pass the three parameters into a function and return
only the Holiday weeks.
Thank you to all who considered my plight and offered solutions.
Cheers
David
.......................................................................................
Date: Thu, 26 Jun 2003 14:59:59 +0200
From: Gustav Brock <gustav at cactus.dk>
Subject: Re: [AccessD] Subqueries assistance please
To: accessd at databaseadvisors.com
Message-ID: <14126953477.20030626145959 at cactus.dk>
Content-Type: text/plain; charset=us-ascii
Hi David
To put one query into another, look up the archives for
"SQL in-line subquery"
The easiest way to extract the value to a textbox is to use DLookup:
=DLookUp("[Weeks]","[qryYourCombinedQuery]")
/gustav