Insert multiple records for a single Id RRS feed

  • Question

  • My project has a 'userid' as an identifier which needs to take a 'fromdate' and 'todate' many times to come up with a count. For example, if the user id is say '1', I need to be able to display like this:

    User Id:1

    1. Fromdate:_____ ToDate:___
    2. Fromdate:_____ ToDate:___
    3. Fromdate:_____ ToDate:___

    and finally, Count used: 3

    Something like that..

    I have tried inserting using a regular insert statement but it would only work for the last 'fromdate' and 'todate' values. How do I insert multiple records for the single userid and yet not lose the old data?

    Any help would be really appreciated!!
    Wednesday, March 3, 2010 3:18 PM

All replies

  • Yes, but the data for "fromdate" and "todate" will be entered randomly-one could be today and the other could be after 6 months. On the 7th month if the user checks back the page, he should still see the one from today. That means, all the data must be stored into a database. Hence the need for this.

    Also, it's not just a single user- the one I gave above is just for a single userid-there's multiple userids for my project. I need to link up each user id with the corresponding 'fromdate' and 'todate'.
    Wednesday, March 3, 2010 3:31 PM
  • These 'todate' and 'fromdate' variables are values entered in by the user of the page. For example, on the form, I might display it like:

    To Date:
    From Date:
    "Submit" button.

    All the user needs to do is hit in the dates and click "submit".  I then need to store the values into a database and pull out and display them whenever I need. 

    And I'm not sure I understand a "combination". 
    Wednesday, March 3, 2010 3:46 PM