CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    38

    Setting Label.Caption from a Date/Time Field Value

    Hi,

    I need to set a labe's caption to a date/time field from a SQL database. I have setup the connetion string and all and I define this variable in VB:

    Dim dtDate As Date
    dtDate = rsInfo.Fields("UploadDate").Value

    The Field "Upload Date" looks like this:

    4/27/2001 11:12:09 AM

    But my label's caption show up like this:

    12:00:00 AM

    How can I set it correctly????? Please Help,

    Herick



  2. #2
    Join Date
    Apr 1999
    Location
    VA BEACH
    Posts
    467

    Re: Setting Label.Caption from a Date/Time Field Value

    Use the Format function to format the date as you want it, and then set the caption to that.

    Jim Hewitt
    Software Developer
    Liberty Tax Service
    www.LibertyTax.com

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

Featured