Results 1 to 4 of 4

Thread: mid/left or right functions

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    I have the following variable that is replacing the "/" with "_" and is taking the first 9 characters to the left. I then place that variable in a text box. txtdate.text is grabbing the date created attribute from a file and putting it into its text property. This works great, the problem occours when the date is say 1/2/2000. On some computers this shows as 1/2/00 leaving three spaces after that. At this point it then grabs the three next characters which are a space, and the first two digits of the time it was created. Example 1/2/00 12. What I want to do is have the date only be thrown into the fdate variable. In other words 11/09/2000. Do anyone see a way to do this? I have tried to format it as a date but it then formats is as the current date????


    Dim fdate As String

    'this names the file according tot he date, client ID and type of doc
    fdate = Left(Replace(txtDate.Text, "/", "_"), 9)

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    MsgBox Format("1/2/00", "ddmmyyyy")
    'or
    MsgBox Format("1/2/00", "dd/mm/yyyy")
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    or in the event of variables
    Code:
    Private Sub Command1_Click()
        x = "1/2/00"
        y = "11/22/2000"
        x = Format(x, "dd/mm/yyyy")
        'or
        y = Format(y, "dd/mm/yyyy")
        MsgBox x & vbCrLf & y
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    When you put in the 1/2/00 or 2000 doesn't that specify that specific date or does it refer to all dates?

Posting Permissions

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



Click Here to Expand Forum to Full Width