Mass update of records

Results 1 to 3 of 3

Thread: Mass update of records

  1. #1
    Join Date
    Dec 1969
    Posts
    440

    Default Mass update of records

    I want to update a certain field in a number of records.<BR>I select them via SAL SELECT statement, something like <BR>"SELECT * From users where age=18"<BR>in all of those records I would like to update the field called "date".<BR><BR>Now the way I see that is looping record by recordusing a recordset object and setting the "date" field to something.<BR>and then using hte .Update method to apply the changes.<BR><BR>If you have any other ways of doing this tell me.<BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default Ugh...a field named Date

    If this is Access, that&#039;s a bad idea, as Date is a keyword.<BR><BR>However...<BR><BR>&#060;%<BR>yourC onnection.Execute( "UPDATE users SET [date]=Now() WHERE age=18" )<BR>%&#062;<BR><BR>If you are using SQL Server, substitute GetDate for Now.<BR><BR>You need to find a good beginner&#039;s book or Web page on SQL.<BR><BR>There used to be an excellent Web page, but it has disappeared. Sigh.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    440

    Default RE: Ugh...a field named Date

    I know that it is a keyword.<BR>The real name of my field is po_id, so its no problem.<BR>Thanks for the cool idea.

Posting Permissions

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