Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    5

    Unanswered: want to rename the displayed field name

    I have the following query where I want to add more user friendly names to the column names that are selected in the query. For instance, I want to display the field Articlegroupname as Product Category. How do I do this ithout altering the underlying field name in the database?

    SELECT Article.articleId
    , Article.articleGroupId
    , POHeader.poHeaderId
    , POHeader.poHeaderId
    , POHeader.supplierId
    , POHeader.locationId
    , POHeader.deliverydate
    , POHeader.poDeliveredValue
    , POHeader.poStatus
    , POHeader.estTotalValue
    , POHeader.receivedTotalValue
    , POHeader.poCurrMultiplier
    , POHeader.poCurrCode
    , POHeader.ourRef
    , POHeader.yourRef
    , POHeader.poComment1
    , POHeader.poComment2
    , POHeader.UserId
    , POHeader.poCurrFactor
    , POHeader.InternalExternal
    , POHeader.CompanyId
    , POHeader.CustKeyIn
    , POLines.poLineId
    , POLines.poHeaderId
    , POLines.articleId
    , POLines.orderQty
    , POLines.receivedQty
    , POLines.articleCost
    , POLines.poLineStatus
    , POLines.newPrice
    , POLines.receiveddate
    , POLines.UserId
    , POLines.spesArticle
    , POLines.invoicedPrice
    , POLines.invoicedValuta
    , POLines.invoicedNOK
    , articleGroup.ArticleGroupName
    , articleGroup.exportAccount
    , articleGroup.exportDept
    , Articlegroup_2.g2_name
    , Article.abc_code
    , Article.articleName
    , Article.articleStatus
    , Article.articleUnit
    , Article.stockInfoId
    , Article.suppliers_art_no
    , Article.tex_color
    , Article.tex_quality
    , Article.tex_size_id
    , Brands.brandLabel
    , Location.locationName
    , Sesong.Sesongnavn
    , Sesong.sesongutgaatt
    , Supplier.name

    FROM HIP.dbo.POLines POLines

    LEFT JOIN HIP.dbo.POHeader
    ON POHeader.poHeaderId=POLines.poHeaderId
    LEFT JOIN HIP.dbo.Article
    ON Article.articleId=POLines.articleId
    LEFT JOIN HIP.dbo.articleGroup
    ON Article.articleGroupId=articleGroup.articlegroupid
    LEFT JOIN HIP.dbo.Articlegroup_2
    ON Article.articleGROUPid2=Articlegroup_2.Articlegrou p_2_Id
    LEFT JOIN HIP.dbo.articleStock
    ON Article.articleId=articleStock.articleId
    LEFT JOIN HIP.dbo.Brands
    ON ARTICLE.BRANDID=BRANDS.BRANDID
    LEFT JOIN HIP.dbo.Location
    ON POHeader.locationID=location.locationID
    LEFT JOIN HIP.dbo.Sesong
    ON Article.sesongID=Sesong.SesongId
    LEFT JOIN HIP.dbo.Supplier
    ON Article.supplierID=supplier.supplierID

  2. #2
    Join Date
    Oct 2005
    Posts
    58
    SELECT Article.articleId as 'My named'
    , Article.articleGroupId as 'My different named'
    , POHeader.poHeaderId as 'My even different named'
    ,
    ....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •