Results 1 to 8 of 8

Thread: convert to date dd,mm,yyyy

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    N.Ireland
    Posts
    651

    convert to date dd,mm,yyyy

    I need to convert this line to date format dd,mm,yyyy

    Whats the correct syntax?

    shipdt = Mid (sstringtobreakdown, 23, 8)
    Gilly

  2. #2
    Addicted Member Supester's Avatar
    Join Date
    Nov 2001
    Location
    The Netherlands
    Posts
    220
    Use the format() function

    example:

    format (sString, "mmddyyyy")

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. shipdt = Format(shipdt, "dd/mm/yyyy")

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    What format is"shipdt" in?

    If it is just an 8 char string (eg 23022001)this might help:



    http://www.vbforums.com/showthread.p...hreadid=125957
    Mark
    -------------------

  5. #5
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    if it is an 8 char string try this:

    Code:
    Dim temp As String
    
    Temp = Mid (sstringtobreakdown, 23, 8)
    shipdt = Left(Temp, 2) & "/" & Mid(Temp, 3, 2) & "/" & Right(Temp, 4)
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Re: convert to date dd,mm,yyyy

    Originally posted by gilly
    I need to convert this line to date format dd,mm,yyyy

    Whats the correct syntax?

    shipdt = Mid (sstringtobreakdown, 23, 8)
    i don't see where you're getting that from ?

  7. #7
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Re: Re: convert to date dd,mm,yyyy

    Originally posted by da_silvy


    i don't see where you're getting that from ?
    It's a long story

    It started off in the ASP section.
    Mark
    -------------------

  8. #8
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    ahh ok. not up to the asp forum yet,

    i'm going to knock over 4000 in vbq&a then move onto others in search of more threads

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