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. Web Development
  3. ASP.NET
  4. Multiple results

Multiple results

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestion
7 Posts 3 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.
  • V Offline
    V Offline
    VK Link
    wrote on last edited by
    #1

    Hi, Setting up a simple survey, where collects email address, answers and display options. Answers stored in database. And using table to select out and display information. There is some logic as to how the answers are displayed. Question - the user can take the survey multiple times. How to query the last set of answers for particular email address, if the user has taken the survey for the second time.

    I 1 Reply Last reply
    0
    • V VK Link

      Hi, Setting up a simple survey, where collects email address, answers and display options. Answers stored in database. And using table to select out and display information. There is some logic as to how the answers are displayed. Question - the user can take the survey multiple times. How to query the last set of answers for particular email address, if the user has taken the survey for the second time.

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      use a timestamp in the table to specify when the test was taken. then just select it out select top 1 * from Answers where personid=1 order by CreateDate I'm not an expert yet, but I play one at work. Yeah and here too. -- modified at 14:26 Monday 12th December, 2005

      V 1 Reply Last reply
      0
      • I Ista

        use a timestamp in the table to specify when the test was taken. then just select it out select top 1 * from Answers where personid=1 order by CreateDate I'm not an expert yet, but I play one at work. Yeah and here too. -- modified at 14:26 Monday 12th December, 2005

        V Offline
        V Offline
        VK Link
        wrote on last edited by
        #3

        Like the way you had specified TOP - is there a BOTTOM or DOWN as well? thanks.

        S I 2 Replies Last reply
        0
        • V VK Link

          Like the way you had specified TOP - is there a BOTTOM or DOWN as well? thanks.

          S Offline
          S Offline
          SABhatti
          wrote on last edited by
          #4

          change the order sorting order to .. CreateDate DESC and you will get bottom record...:-D -----

          1 Reply Last reply
          0
          • V VK Link

            Like the way you had specified TOP - is there a BOTTOM or DOWN as well? thanks.

            I Offline
            I Offline
            Ista
            wrote on last edited by
            #5

            only a DIAGONAL!! :wtf: I'm not an expert yet, but I play one at work. Yeah and here too.

            V 1 Reply Last reply
            0
            • I Ista

              only a DIAGONAL!! :wtf: I'm not an expert yet, but I play one at work. Yeah and here too.

              V Offline
              V Offline
              VK Link
              wrote on last edited by
              #6

              Thanks for all the "great" ideas! solved the problem by adding a random number after the email address, so that way it will always be unique. And delete the number after email address to restore the original email address.

              I 1 Reply Last reply
              0
              • V VK Link

                Thanks for all the "great" ideas! solved the problem by adding a random number after the email address, so that way it will always be unique. And delete the number after email address to restore the original email address.

                I Offline
                I Offline
                Ista
                wrote on last edited by
                #7

                just use an identity field instead. its easier. although the timestamp will make it unique I'm not an expert yet, but I play one at work. Yeah and here too.

                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