Re: Cycling numbers and too few variables error
- From: Tim Ferguson <FergusonTG@xxxxxxxxxxxx>
- Date: Mon, 19 Dec 2005 09:59:16 -0800
"=?Utf-8?B?Q2hyaXN0YWFheQ==?=" <Christaaay@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in news:3D53C9B5-EA6A-49B2-AC7A-FE4A740F8278@xxxxxxxxxxxxx:
> So far i haven't been able to get the code to run successully from a
> form or through VBA.
What code? You have some VBA, you have two SQL queries. We know that one
of the SQL queries is causing an error, but you haven't said which!
> I've double checked the fields and they are all
> there and spelled correctly.
Okay...
> One query that could be the issue isbelow.
SELECT
Last(tbl_Email_Data.Count_ID) AS LastOfCount_ID,
tbl_Email_Data.queue_key
FROM tbl_AssocTbl
INNER JOIN tbl_Email_Data
ON tbl_AssocTbl.Queue = tbl_Email_Data.queue_key
WHERE tbl_AssocTbl.cycled_ind = True
AND tbl_Email_Data.request_type Not In ("rt14")
GROUP BY tbl_Email_Data.queue_key
HAVING tbl_Email_Data.queue_key Is Not Null
ORDER BY Last(tbl_Email_Data.Count_ID);
This is presumably the qryGetQueueRoutingCycle querydef. I cannot see
what might be wrong with it, but LAST() is a function I very rarely use.
I don't see how it could produce a sensible result unless the recordset
was sorted on the ORDER BY clause before the grouping of the GROUP BY
clause, and I don't think that is true. The function does not seem to
exist like this in any real database language. As I asked above, does
this query [a] run successfully from the UI (double-click it in the
Database window), and [b] give the right answers?
> thoughts?
When you have to jump through hoops like this to get to a fairly simple
fact ("Who has been rostered recently?"), then I start to wonder about a
Major Design Problem...
B Wishes
Tim F
.
- Follow-Ups:
- Re: Cycling numbers and too few variables error
- From: Christaaay
- Re: Cycling numbers and too few variables error
- References:
- Cycling numbers and too few variables error
- From: Christaaay
- Re: Cycling numbers and too few variables error
- From: Tim Ferguson
- Re: Cycling numbers and too few variables error
- From: Christaaay
- Cycling numbers and too few variables error
- Prev by Date: Re: Cycling numbers and too few variables error
- Next by Date: Re: How do format a SQL Insert Statement
- Previous by thread: Re: Cycling numbers and too few variables error
- Next by thread: Re: Cycling numbers and too few variables error
- Index(es):
Relevant Pages
|