Results 1 to 2 of 2

Thread: Date formats in Access via VB6

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    I am fairly new to VB and am accessing an Access database which contains dates. Does anyone have a recommended format for a date field (without time). I just need a pointer as to how to define it in Access and then how to validate it in VB6. Is there a standard or best way to do this? Thanks for all your help.

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Define the date field in whatever format you desire, in Access. It's going to keep the internal representation (a float) no matter what you choose. The Decimal portion of the number (should you decide to test the date value by converting it to a long) represents the number of days since 12/30/1899. The statement Cint(Date), currently, should give a number > 36400.

    VB6 has a new function "IsDate" that returns a boolean value. You can use this and some combination of the DateAdd function to test a dates validity.

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