I need some help with a query

  • Hi,
    I need some help with a query. In the picture you see three tables.
    I want all rows in tblSales and ProdDesc from tblProctAttributes.
    The problem I am running into is, if there is no record in ProductAttributes which corresponds to tblProducts.ProductSKU then  the tblSales row gets filtered out. does anyone know a way around this?
    Thanks

  • Instead of using a JOIN, try using a LEFT JOIN to your tblproductAttributes.

    If you want a more in depth answer (with an example), have a look at the link in my signature, that explains how to post T-SQL questions. 🙂

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • progmgppers - Monday, October 23, 2017 7:55 AM

    Hi,
    I need some help with a query. In the picture you see three tables.
    I want all rows in tblSales and ProdDesc from tblProctAttributes.
    The problem I am running into is, if there is no record in ProductAttributes which corresponds to tblProducts.ProductSKU then  the tblSales row gets filtered out. does anyone know a way around this?
    Thanks

    The query designer produces ugly code and it's useless if you want to do anything complex.  You're better off learning to just write out your code by hand.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • drew.allen - Tuesday, October 24, 2017 1:40 PM

    progmgppers - Monday, October 23, 2017 7:55 AM

    Hi,
    I need some help with a query. In the picture you see three tables.
    I want all rows in tblSales and ProdDesc from tblProctAttributes.
    The problem I am running into is, if there is no record in ProductAttributes which corresponds to tblProducts.ProductSKU then  the tblSales row gets filtered out. does anyone know a way around this?
    Thanks

    The query designer produces ugly code and it's useless if you want to do anything complex.  You're better off learning to just write out your code by hand.

    Drew

    Co-worker of mine is just now learning this himself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply