Announcement

Collapse
No announcement yet.

MS Access Query Help Required - Only populate columns if output is unique

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MS Access Query Help Required - Only populate columns if output is unique

    HI - any MS Access experts out there - a bit of help would be appreciated. I have this MS Access query code:

    Code:
    SELECT  [Catalog section].sPageName,  [Catalog section].sPageTitle, Product.[Short description] FROM [Catalog section] INNER JOIN Product ON [Catalog section].nSectionID = Product.nParentSectionID WHERE Product.[Product Reference] not like '*!*' AND Product.[Price] <> 0 ORDER BY sPageName ;
    Which produces this - populating every field on every row. I want the output to only populate columns 1 and 2 if the data is unique, but always to populate column 3.

    This is what I get

    Link to image

    This is what I want

    Link to image

    Any help would be appreciated
    Regards
    David

    #2
    not a perfect solution but certainly a workable solution
    assuming the cells are exactly the same as per image 1

    in cell D1 type the following equation
    =A1
    in cell E1 type the following equation
    =B1
    in cell F1 type the following equation
    =C1
    in cell D2 type the following equation
    =IF(A2=A1,"",A2)
    in cell E2 type the following equation
    =IF(B2=B1,"",B2)
    in cell F2 type the following equation
    =C2
    now highlight cells D2 and E2 and F2 and drag down as far as you need

    now columns D and E and F are the output you require
    kevin

    Comment


      #3
      Hi Kevin - thanks for the reply. I was really looking at doing this within the SQL SELECT statement as I want to import changes back into the database.
      Regards
      David

      Comment

      Working...
      X