Results 1 to 2 of 2

Thread: Still need help.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    St. Louis, MO USA
    Posts
    21

    Post

    I have code that combines the text of two text boxes. It is a date and time combination.
    For example dateplus = cdate(startdate.text & " " & stopdate.text, "mmddyyhhnn")

    now I want to break this back down to just the time to compare to another time. I need to use the time the dateplus value has accumulated and not the original time.

    In other words I need to break down and get just the time out of the date plus value in
    order to set a condition of is it greater than cdate("9:59pm")

    Suggestions?

    cdate(dateplus, "hhnn") does not appear to be working?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Not a problem:

    Lets say you have your date stored as 1/1/99 11:35PM

    Code:
    Dim strMsg As String
    Dim datDate As Date
    
    datDate = Cdate("1/1/99 11:35PM")
    strMsg = Format(dtDate, "hh:mmAMPM")
    MsgBox strMsg
    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819



    [This message has been edited by Serge (edited 12-10-1999).]

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