Results 1 to 3 of 3

Thread: date converting

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    15

    Question

    I have a TextBox that accepts only 4 numbers before the user
    can click the OK button.

    And what do I want to do with this?

    I want to check if the number entered in the TextBox is more
    than 2 years away(lower) from the actual date's year

    How can I do this?
    How can I convert the TextBox.Text into
    date format.
    I'm not like them
    but I can pretend

  2. #2
    Guest
    Coming out of the text box, you have string masquerading as
    a numeric.

    You could compare abs(val(textbox.text) - year(now())) > 2

    Is this what you were looking for?


    Good Luck
    DerFarm

  3. #3
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    You can use the CDate function to convert a string or number value to the date data type.

    But before you do that you want to validate that it is valid information that the user entered. You can do that by using the IsDate Function.

    And to find out the two year difference you can use the DateDiff function.

    Um americano que fala portugues.

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