David,
I tried what you said and it worked. However in the meantime I changed from using views to using the tables directly (did not know if the view was causing the problem). So my code now looks like the following (I'm streamlining it to see if I can get to understand what's going on)
Code:
Dim woodInv As New BusinessObjects.TblWoodInventoryQuery("wi")
Dim ytdInv As New BusinessObjects.TblWoodInventoryHistoryQuery("ytd")
woodInv.Select(woodInv.Specie, woodInv.InventoryType, ytdInv.Select(ytdInv.Bdft.As("BF")))
woodInv.InnerJoin(ytdInv).On(woodInv.Specie.Equal(ytdInv.Specie))
Dim woodInvColl As New BusinessObjects.TblWoodInventoryCollection
woodInvColl.Load(woodInv)
When I run the above code snippet, I get the following SQL statement.
Code:
SELECT wi.[specie] AS 'specie',wi.[inventoryType] AS 'inventoryType',ytd.* FROM [tblWoodInventory] wi
INNER JOIN [tblWoodInventoryHistory] ytd ON wi.[specie] = ytd.[specie]
It seems that the SubQuery is selecting all of my columns rather than just the one I am asking for.
Any thoughts?
Thanks again
Lee