Results 1 to 2 of 2

Thread: How to display long date formats in VB5 code?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Location
    Landover, MD, USA
    Posts
    1

    Post

    When attempting to read date information from an MS Access dB into a VB5 app, cannot display date using long format (i.e., January 13,1999). NOTE: Verified that Access dB table and associated query both use long date format. Also, verified that associated query when executed within Access displays long date format. The following VB5 code is used to open and retrieve data from the Access dB:
    Set qdfTmp = gdbDataStore.QueryDefs("qrySemDate")
    Set rstTmp = qdfTmp.OpenRecordset(dbOpenSnapshot)
    If Not rstTmp.EOF Then
    rstTmp.MoveLast
    rstTmp.MoveFirst

    intRecIndex = 1
    Do Until rstTmp.EOF
    grdSchedule.AddItem CStr(intRecIndex)
    & Chr(9) & rstTmp!semDate
    intRecIndex = intRecIndex + 1
    rstTmp.MoveNext
    Loop
    End If

    P.S. - Any and all assistance in resolving this problem would be greatly appreciated !!!

  2. #2
    Member
    Join Date
    Feb 1999
    Location
    Lexington,kentucky,USA
    Posts
    61

    Post

    You can use format function

    Assume:

    Systemdate="1/3/99" ' Or any date format
    FormatteDate= format(trim(systemdate),"dd mmmm yy"
    Contents of FormattedDate are '30 July 99'

    for more information
    Checkout format function

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