updating multiple records in one table

Results 1 to 2 of 2

Thread: updating multiple records in one table

  1. #1
    Join Date
    Dec 1969

    Default updating multiple records in one table

    I&#039;m trying to update several date fields in a small table, the structure is <BR>TermName &#124 StartDate &#124 EndDate<BR>I&#039;m using the post method from the capture (form) page. There are multiple sorts of termname witha start date and endate on the form page, with a single submit button.<BR>The form is calling the response page which then needs to update th emultiple fields with the new info. Is it true to say that Using the UPDATE command, I can only set one criteria, and thus cahnge only one row in the table? Any ideas on how I can update all of the rows simultaneously would be really appreciated.<BR>Thank you in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: updating multiple records in one table

    Syntax depends on what database your using...<BR>But yes, update and using the where criteria, the update will update every record where the criteria matches...<BR><BR>sql="UPDATE Members Set (Members.Status = 1) Where (Members.ID &#062;10)"<BR>Conn.Execute(sql)<BR><BR>So in my members table this update will change any value in the Status Field to 1, for any member that has a greater ID than 10<BR><BR>So if i had ID&#039;s from 1 to 100<BR>records 11 to 100 will get changed...<BR><BR>Now carefull when you do this...<BR>working with dates can be a pain toget right.<BR>If you have a prob, post relevent code here<BR>along with what DB your using.<BR><BR>Russell M

Posting Permissions

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