Hey kids,I'm attempting to pull a data set in to excel that displays current active inventory in our system, by store and SKU. Getting the actual store's name is tricky...the system doesn't give you the store's name directly, instead it gives you a column called StoreNameID in the iQClerk_Stores table, which you need to join with ReferenceID from a table called LanguageTranslations, and use the FieldText column from that table to get the actual store name. Complicated right? It looks something like this:SELECT LanguageTranslations.FieldText, iQclerk_Stores.StoreID, iQclerk_GlobalProducts.ProductIdentifier, iQclerk_StoresAndNonSellableProducts.QuantityFROM ArchTelecom.dbo.iQclerk_GlobalProducts iQclerk_GlobalProducts, ArchTelecom.dbo.iQclerk_Stores iQclerk_Stores, ArchTelecom.dbo.iQclerk_StoresAndNonSellableProducts iQclerk_StoresAndNonSellableProducts, ArchTelecom.dbo.LanguageTranslations LanguageTranslationsWHERE iQclerk_StoresAndNonSellableProducts.StoreID = iQclerk_Stores.StoreID AND iQclerk_Stores.StoreNameID = LanguageTranslations.ReferenceID AND iQclerk_GlobalProducts.GlobalProductID = iQclerk_StoresAndNonSellableProducts.GlobalProductID AND ((iQclerk_Stores.Enabled=1))
And the expected result looks like this: Quantity FieldText StoreID ProductIdentifier1 GrandAve 37 ACCCCCC11011 GrandAve 37 ACCCCCC11011 Dover 52 ACCCCCC11051 Main 37 ACCCCCC1106...
Anyway, I'd like to SUM up the Quantity column, but that weird FieldText field doesn't play nice with GROUP BY it seems. So when I change the code to look like this:SELECT iQclerk_Stores.StoreID, iQclerk_GlobalProducts.ProductIdentifier, LanguageTranslations.FieldText Sum(iQclerk_StoresAndNonSellableProducts.Quantity)FROM ArchTelecom.dbo.iQclerk_GlobalProducts iQclerk_GlobalProducts, ArchTelecom.dbo.iQclerk_Stores iQclerk_Stores, ArchTelecom.dbo.iQclerk_StoresAndNonSellableProducts iQclerk_StoresAndNonSellableProducts, ArchTelecom.dbo.LanguageTranslations LanguageTranslationsWHERE iQclerk_StoresAndNonSellableProducts.StoreID = iQclerk_Stores.StoreID AND iQclerk_Stores.StoreNameID = LanguageTranslations.ReferenceID AND iQclerk_GlobalProducts.GlobalProductID = iQclerk_StoresAndNonSellableProducts.GlobalProductID AND ((iQclerk_Stores.Enabled=1))GROUP BY iQclerk_Stores.StoreID, iQclerk_GlobalProducts.ProductIdentifier
I get this error:https://www.dropbox.com/s/ripkhnlh1yuz9sc/field%20text.pngHope this is enough info. Any help is much appreciated!