Thanks Pascal.  Yes some of my Agents don't have properties so i'm gettin the below error:

Error Executing Database Query.  
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified _expression_ 'PropertyAgentID' as part of an aggregate function.  

My code is below:

<CFQUERY NAME="GetAgentList" datasource="020">
SELECT
PropertyAgent.PropertyAgentID,
PropertyData.PropertyAgentID,
Count(PropertyData.PropertyDataID) as PropertyCount
FROM PropertyAgent, PropertyData
WHERE PropertyAgent.PropertyAgentID = PropertyData.PropertyAgentID
GROUP BY PropertyAgent.PropertyAgentID
</CFQUERY>

Do you think that is why the error is coming up like so, because it needs an outer join?

Stu

---------- Original Message ----------------------------------
From: "Pascal Peters" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Thu, 19 Feb 2004 16:12:49 +0100

>FROM PropertyAgent, PropertyData
>WHERE PropertyAgent.PropertyAgentID = PropertyData.PropertyAgentID
>GROUP BY PropertyAgent.PropertyAgentID
>
>If you have agents without properties, you will need an outer join
>
>Pascal
>
>> -----Original Message-----
>> From: Stuart Kidd [mailto:[EMAIL PROTECTED]
>> Sent: donderdag 19 februari 2004 16:09
>> To: CF-Talk
>> Subject: DB Stuff
>>
>> Hi guys,
>>
>> I'm trying to pull some details from my Access DB.  I'm
>> trying to list the PropertyAgent's details and also list (as
>> a count) how many properties (propertydataid) they have.
>>
>> <CFQUERY NAME="GetAgentList" datasource="020"> SELECT
>> PropertyAgent.PropertyAgentID, PropertyAgent.PropertyAgentCompanyName,
>> PropertyAgent.PropertyAgentContactSurname,
>> PropertyAgent.PropertyAgentContactFirstName,
>> PropertyAgent.PropertyAgentVillageTown,
>> PropertyAgent.PropertyAgentAuthorityLevel,
>> Count(PropertyData.PropertyDataID) as PropertyCount FROM
>> PropertyAgent, PropertyData </CFQUERY>
>>
>> If somebody could help it would be appreciated.
>>
>> Thanks,
>>
>> Stuart
>>
>> ps: i'm going to put in the cfparams after.
>>
>>  
>>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to