Bill Benson
bensonforums at gmail.com
Thu Jan 1 11:45:41 CST 2015
I want to create an item number column in a query via DCOUNT. The syntax below is "correct" in that the query runs; however the result in the Item column is #Error. Can it be fixed? My schema appears below: SELECT B.PhonePhoneTypeID, A.Phone, C.PhoneType, DCount("PhonePhoneTypeID","PhonePhoneTypes","PhonePhoneTypeID<=" & B.PhonePhoneTypeID & " And FKCompanyPhoneID In (Select CompanyPhoneID From CompanyPhone Where FKCompanyID = " & A.FKCompanyID&")") as Item FROM PhoneType as C RIGHT JOIN (Phone as A INNER JOIN PhonePhoneTypes as B ON A.CompanyPhoneID = B.FKCompanyPhoneID) ON C.PhoneTypeID = B.FKPhoneTypeID order by B.PhonePhoneTypeID ASC Phone (A) CompanyID Company FKCompanyTypeID Address Deleted CompanyPhone (A)