Results 1 to 3 of 3

Thread: Division by zero (on a date)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241
    I have a small problem. I have a division by zero error when using the following date value: 22/06/00 (which is today's date). My division by zero error occurs because of the trailing /00.

    I went in the regional setting and used "-" as date seperator and now it works perfectly. Since it's an application I will use on many computers, I would like it to work without having to play with the regional settings. (same thing if I would put the year of 4 digits)

    I tried using cdate() and format([date],"Short date") on my value but it won't work. Is there a way of getting around this?

    Thanks.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Code:
    dim stDate as String
    
    stDate = Format(now, "dd-mm-yy")
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241
    Now that's quick for an answer.

    love this place..

    Thanks.

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