Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: When then to create mult columns

    I have a colm day and colm sales, I would like to have a column for each day of week i think i can use when then but not sure how

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    select case when datepart(...) then ... end as mondie_sales
         , case when datepart(...) then ... end as toosdie_sales
         , eck_settera
      from ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2005
    Posts
    122
    You're asking how to transform your day rows to a week row with one column for each day? If so, take a look at the PIVOT function (SQL Server 2005 only).

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by mikezx10
    I have a colm day and colm sales
    What's a "colm day"? Is that meant to be a "calm day"?
    I have no clue what you are talking about.

Posting Permissions

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