Results 1 to 2 of 2

Thread: converet date dd/mmm/yyyy to numeric equivalent

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2008
    Posts
    77

    converet date dd/mmm/yyyy to numeric equivalent

    i have a data field that comes in as dd/mmm/yyyy

    ex: 19/Jun/2009

    excel turns that into 19-Jun-2009 or 39983

    is there VB code to convert that date format to its nummeric equivalent?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: converet date dd/mmm/yyyy to numeric equivalent

    Using the 39983, 19 Jun 09 example:

    Yes: Format( CDate(39983) , "d/mmm/yyyy") equals 19/Jun/2009
    Likewise: Format( CDate(39983) , "d-mmm-yyyy") equals 19-Jun-2009

    If your data field is a date field, not text, then: CDbl(Field's.Value) equals 39983
    If your data field is a text field, you can try this, but no guarantee VB will interpret it correctly:
    CDbl(CDate(Field's.Value))) may equal 39983
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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