Results 1 to 4 of 4
  1. #1
    laniebe is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    17

    Question Convert Customs System Date or Normal Date MM/DD/YYYY

    Hello! Our system outputs transaction dates in the following format CYYMMDD (C = Century, which is always 1). I would like to convert CYYMMDD to MM/DD/YYYY. How can I do this? Thank you so very much!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Code:
    Public Function FixDate(ByVal pvSysDate)
    Dim Y, m, d
    dim vDat
    
        Y = Mid(pvSysDate,2,2)
        m = Mid(pvSysDate, 4, 2)
        d = Mid(pvSysDate, 6, 2)
    
    vDat =  m & "/" & d & "/" & y
    FixDate=format( vDat ,"mm/dd/yyyy")
    End Function

  3. #3
    laniebe is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    17
    ranman256, Thank you! Could you tell me where I write that into my database? Sorry for my ignorance. I know enough to get myself stuck all the time.

    Quote Originally Posted by ranman256 View Post
    Code:
    Public Function FixDate(ByVal pvSysDate)
    Dim Y, m, d
    dim vDat
    
        Y = Mid(pvSysDate,2,2)
        m = Mid(pvSysDate, 4, 2)
        d = Mid(pvSysDate, 6, 2)
    
    vDat =  m & "/" & d & "/" & y
    FixDate=format( vDat ,"mm/dd/yyyy")
    End Function

  4. #4
    laniebe is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    17
    ranman256, Nevermind! I figured it out! Thank you again for the information, it worked perfectly!

    Quote Originally Posted by laniebe View Post
    ranman256, Thank you! Could you tell me where I write that into my database? Sorry for my ignorance. I know enough to get myself stuck all the time.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 06-26-2015, 08:55 PM
  2. Replies: 3
    Last Post: 12-02-2014, 07:58 PM
  3. Replies: 1
    Last Post: 01-18-2014, 08:33 PM
  4. Replies: 12
    Last Post: 03-09-2011, 04:16 PM
  5. Replies: 1
    Last Post: 06-11-2009, 05:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums