Results 1 to 6 of 6

Thread: FornAt records

  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With tipical con ado plese...
    Admit have in a fiele 267.654 vAlue similar:
    09876
    987
    4500
    ...
    Is possible to updat all vAlue in this format #0000 instead to' use the loop all record and update with the new format?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try

    Code:
    Dim strSQL As String
    strSQL = "UPDATE MyTable SET MyField = Format(MyField, ""#0000"")"
    cnn.Execute strSQL
    where:

    MyTable is the name of the table.
    MyField is the name of the field.
    cnn is the name of the ADODB connection variable.

    Edited to correct format string

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Try

    Code:
    Dim strSQL As String
    strSQL = "UPDATE MyTable SET MyField = Format(MyField, ""####"")"
    cnn.Execute strSQL
    where:

    MyTable is the name of the table.
    MyField is the name of the field.
    cnn is the name of the ADODB connection variable.
    But you use #### instead #0000 is the same way?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Quote Originally Posted by sal21 View Post
    But you use #### instead #0000 is the same way?
    Sorry, change #### to #0000.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Sorry, change #### to #0000.
    ok but #0000 is the same 0000?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Yes.

Posting Permissions

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