SQL
SELECT[T].ProductKey,[P].Description1,[T].LotKey,[T].Quantity_Alt,[T].Quantity_Stk,[T].UserID,[T].TransactionTime,[PL].ProductionDate,[T].PalletIDFROM(((DC_Transactions[T]INNERJOINDC_Lines[L]ON[T].LineCode=[L].LineCode)INNERJOINIC_Products[P]ON[T].ProductKey=[P].ProductKey)INNERJOINIC_ProductLots[PL]ON[T].LotKey=[PL].LotKey)WHERE(([T].LotKeyin(SelectLotKeyfromDC_transactionswhere[T].[TransactionDate]={ts'2015-11-17 00:00:00'}and[L].[LineType]=2)))ORDERBY[T].ProductKey
I am trying to create a derived table but failing miserably. I would like the where section to be in the from section. I would like to pull [T].Lotkey from this table
We have multiple pallet ID's for certain lots throughout there life.
So at the moment i am running a second query sorted by individual Lots to...