Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. About reporting

About reporting

Scheduled Pinned Locked Moved Database
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    i need to get report from a table which has questionId field, studentId, inquiryId like that and there are 80 questions and 300 students replied this inquiry. I need a result like below (question=q) inqueryId studentId q1 q2 q3 q4 q5 ..... q79 q80 7 123 a b b c d e c 7 245 b c d e e c c i create temporary table has 80 question field but i cant fill it from my original table

    Sampiyon FENERBAHCE

    H 1 Reply Last reply
    0
    • T TALHAKOSEN

      i need to get report from a table which has questionId field, studentId, inquiryId like that and there are 80 questions and 300 students replied this inquiry. I need a result like below (question=q) inqueryId studentId q1 q2 q3 q4 q5 ..... q79 q80 7 123 a b b c d e c 7 245 b c d e e c c i create temporary table has 80 question field but i cant fill it from my original table

      Sampiyon FENERBAHCE

      H Offline
      H Offline
      HemJoshi
      wrote on last edited by
      #2

      U need to craete a dynamic query for inserting data in the table like declare @Dynstr varchar(4000) set @Dynstr ='update #TempDyamicWeek SET col'+cast(@count1 as varchar(10)) +' =#TempDurByWeek.duration from #TempDyamicWeek inner join #TempDurByWeek on #TempDyamicWeek.userid= #TempDurByWeek.userid and #TempDyamicWeek.type=#TempDurByWeek.type and #TempDurByWeek.WeekEnding= '''+convert(varchar(30),@CurDateTo,121)+'''' exec (@Dynstr) please coorect the colume name according to yours.. Thanks Hem

      T 1 Reply Last reply
      0
      • H HemJoshi

        U need to craete a dynamic query for inserting data in the table like declare @Dynstr varchar(4000) set @Dynstr ='update #TempDyamicWeek SET col'+cast(@count1 as varchar(10)) +' =#TempDurByWeek.duration from #TempDyamicWeek inner join #TempDurByWeek on #TempDyamicWeek.userid= #TempDurByWeek.userid and #TempDyamicWeek.type=#TempDurByWeek.type and #TempDurByWeek.WeekEnding= '''+convert(varchar(30),@CurDateTo,121)+'''' exec (@Dynstr) please coorect the colume name according to yours.. Thanks Hem

        T Offline
        T Offline
        TALHAKOSEN
        wrote on last edited by
        #3

        thanks a lot

        Sampiyon FENERBAHCE

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups