Your query is
Select * from qryAllParticipants Where ProvinceStateID = 'CAAB' AND
DateReceived >= #1/1/2007# AND DateReceived<= #11/30/2007#
That's querying qryAllParticipants, and the only fields that exist in that
query are ProvinceStateID, RunSiteID, City, CompanyID, Total, Name, Address,
Email and PhoneNumber. If you need to be able to refer to DateReceived in
this query, you need to add Donation.DateReceived to the list of fields that
qryAllParticipants is returning. That fact that qryAllParticipants refers to
DateReceived doesn't make any difference: it must be in the list of fields
between SELECT and FROM.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Johnny Bright"
discussions.microsoft.com> wrote in message
news:B9935A9B-FA89-4F89-B5D7-3FF7DBE3AE14@microsoft.com...
> DateReceived is part of the where clause in the query. > > WHERE
> (((Donation.DateReceived)>=[Forms]![frmLook]![txtBegin] And
>>> (Donation.DateReceived)<=[Forms]![frmLook]![txtEnd]))
>
> The query is activated by a button on frmLook so the form is definitely
> open! I suppose if this stuff was easy, everybody would be doing it! :-)
> Any ideas?
>
>
> "Douglas J. Steele" wrote:
>
>> I don't see DateReceived as a field in qryAllParticipants. The only
>> fields
>> that are returned are ProvinceStateID, RunSiteID, City, CompanyID, Total,
>> Name, Address, Email and PhoneNumber (remember, if it's not in the SELECT
>> part, you can't refer to it.)
>>
>> Also, the query is looking for [Forms]![frmLook]![cboProv]. Is the form
>> open?
>>
>> --
>> Doug Steele, Microsoft Access MVP
>>
http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> "Johnny Bright"
discussions.microsoft.com> wrote in message
>> news:870F22BF-11CA-44EC-B77A-471A71F7B11E@microsoft.com...
>>> The Immediate window shows:
>>> Select * from qryAllParticipants Where ProvinceStateID = 'CAAB' AND
>>> DateReceived >= #1/1/2007# AND DateReceived<= #11/30/2007#
>>>
>>> the sql for the query is:
>>>
>>> SELECT
Runner.ProvinceStateID, RunSite.RunSiteID, RunSite.City,
>>>
Runner.CompanyID, Sum(Donation.Amount) AS Total, Runner.FirstName & " "
>>> &
>>> Runner.LastName AS Name, Runner.Address1 & " " & Runner.Address2 & " "
>>> &
>>> Runner.City AS Address, Runner.Email, Runner.PhoneNumber
>>> FROM RunSite INNER JOIN (Runner INNER JOIN Donation ON Runner.RunnerID
>>> =
>>> Donation.RunnerID) ON RunSite.RunSiteID = Runner.RunSiteID
>>> WHERE (((Donation.DateReceived)>=[Forms]![frmLook]![txtBegin] And
>>> (Donation.DateReceived)<=[Forms]![frmLook]![txtEnd]))
>>> GROUP BY
Runner.ProvinceStateID, RunSite.RunSiteID, RunSite.City,
>>>
Runner.CompanyID, Runner.FirstName & " " & Runner.LastName,
>>> Runner.Address1 &
>>> " " & Runner.Address2 & " " & Runner.City, Runner.Email,
>>> Runner.PhoneNumber
>>> HAVING (((
Runner.ProvinceStateID)=[Forms]![frmLook]![cboProv]));
>>>
>>> Thanks! I really appreciate your help!
>>>
>>> "Douglas J. Steele" wrote:
>>>
>>>> What gets printed to the Immediate window by the Debug.Print
>>>> statement?
>>>>
>>>> What's the SQL for qryAllParticipants?
>>>>
>>>> --
>>>> Doug Steele, Microsoft Access MVP
>>>>
http://I.Am/DougSteele
>>>> (no e-mails, please!)
>>>>
>>>>
>>>> "Johnny Bright"
discussions.microsoft.com> wrote in
>>>> message
>>>> news:AAD5FEB2-195F-4352-A12D-D21EA9D33991@microsoft.com...
>>>>> Well, I did have Received spelled wrong so I thought that would fix
>>>>> it
>>>>> but
>>>>> it's still not working! Still getting too few parameters. Does
>>>>> this
>>>>> code
>>>>> look right?
>>>>>
>>>>> mySQL = "Select * from qryAllParticipants " _
>>>>> & "Where ProvinceStateID = '" & Me.cboProv & "' " _
>>>>> & "AND DateReceived >= #" & Me.txtBegin & "# " _
>>>>> & "AND DateReceived<= #" & Me.txtEnd & "#"
>>>>>
>>>>> Debug.Print mySQL
>>>>> Set rstQueryData = db.OpenRecordset(mySQL, dbOpenSnapshot)
>>>>
>>>>
>>>>
>>
>>
>>