Hi,
I created a query in Design mode, and now see (after getting unexpected results) the SQL generated is different than what I would have expected.
I have a main table, tblSpaceUse, and 4 lookup tables that I need to read for descriptions.
I add tblSpaceUse first in design mode, and then add the 4 lookup tables.
The SQL generated lists one of the lookup tables first, after the FROM clause. I would have expected my main table, tblSpaceUse, to be listed first. This is creating problems in the results. I have tried to change the SQL on my own, but am having no luck (I get Join errors). Also tried adding tables one by one in design mode, but ACCESS always changes the SQL to having a lookup table first, and tblSpaceUse last.
Here is the SQL generated. Notice tlkpDesignType is first after the FROM.
Can someone help me change this around so tblSpaceUse is first? (and why is the SQL generator making it like this?)
Thank you very much in advance.
I created a query in Design mode, and now see (after getting unexpected results) the SQL generated is different than what I would have expected.
I have a main table, tblSpaceUse, and 4 lookup tables that I need to read for descriptions.
I add tblSpaceUse first in design mode, and then add the 4 lookup tables.
The SQL generated lists one of the lookup tables first, after the FROM clause. I would have expected my main table, tblSpaceUse, to be listed first. This is creating problems in the results. I have tried to change the SQL on my own, but am having no luck (I get Join errors). Also tried adding tables one by one in design mode, but ACCESS always changes the SQL to having a lookup table first, and tblSpaceUse last.
Here is the SQL generated. Notice tlkpDesignType is first after the FROM.
Code:
SELECT tblSpaceUse.*, tlkpRoomCategory.RoomCategoryDesc, tlkpRoomType.RoomTypeDesc, tlkpView.ViewDesc, tlkpDesignType.DesignDescription
FROM tlkpDesignType INNER JOIN (tlkpView INNER JOIN (tlkpRoomType INNER JOIN (tblSpaceUse INNER JOIN tlkpRoomCategory ON tblSpaceUse.RoomCategoryID=tlkpRoomCategory.RoomCategoryID) ON tlkpRoomType.RoomTypeID=tblSpaceUse.RoomTypeID) ON tlkpView.ViewCode=tblSpaceUse.ViewID) ON tlkpDesignType.DesignType=tblSpaceUse.DesignTypeID;
Thank you very much in advance.