Thread: Access Query
View Single Post
  #1 (permalink)  
Old January 11th, 2006, 04:02 AM
gre_smi gre_smi is offline
Registered User
 
Join Date: Nov 2005
Location: Cape Town, WC, South Africa.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Query

Hi All
Could someone assist me with this.I have an Access Query that I try to run but it keeps giving me an error.

[u]Error:-</u>Syntax Error(Missing Operator)In Query Expression 'Instrument.InstrumentCode = GroupsRelationships.Instr_Port_Id LEFT JOIN GroupsCategories On GroupsRelationships.CategoryId = GroupsCategories.CategoryId LEFT JOIN Groups On GroupsCategories.GroupId = Groups.GroupId LEFT JOIN InsCategory On (Instrument.'.

Query:-[u]</u>

SELECT Instrument.InstrumentCode, Instrument.InstrumentDescription, IIf( IsNull,'Unassigned',"GrpName") AS GrpName, IIf( IsNull,'Unassigned',"CategoryName") AS CatName,InsCategory.CategoryDescription, InsSubCategory.SubCategoryDescription,InsClass.Cla ssDescription FROM Instrument LEFT JOIN GroupsRelationships ON Instrument.InstrumentCode = GroupsRelationships.Instr_Port_ID
LEFT JOIN GroupsCategories ON GroupsRelationships.CategoryID = GroupsCategories.CategoryID
LEFT JOIN Groups ON GroupsCategories.GroupID = Groups.GroupID
LEFT JOIN InsCategory ON (Instrument.ReportDate = InsCategory.ReportDate
AND Instrument.RevisionDate = InsCategory.RevisionDate
AND Instrument.CategoryCode = InsCategory.CategoryCode
LEFT JOIN InsClass ON (Instrument.ClassCode = InsClass.ClassCode
AND Instrument.ReportDate = InsClass.ReportDate
AND Instrument.RevisionDate = InsClass.RevisionDate
LEFT JOIN InsSubCategory
ON Instrument.SubCategoryCode = InsSubCategory.SubCategoryCode
AND Instrument.ReportDate = InsSubCategory.ReportDate
AND Instrument.RevisionDate = InsSubCategory.RevisionDate
WHERE Instrument.RevisionDate = DateValue('" & RevisionDate & "')
AND Instrument.ReportDate = DateValue('" & ReportDate & "')
AND Groups.GroupName = ('" & Groups(0) & "')
AND Groups.GroupType = ('" & GroupType & "')
ORDER BY Instrument.InstrumentCode, GroupsRelationships.GroupID DESC ,
GroupsRelationships.CategoryID DESC ,
InsCategory.CategoryDescription, InsSubCategory.SubCategoryDescription, InsClass.ClassDescription
Reply With Quote