Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filling an ADO recordset with hours (2003)

    By clicking the "Input Date" button on the startup form of the attached mdb, I'd like to fill the form with 4 records corresponding to the date selected on the Calendar. What is the right format to assign to hours and minutes to a field in a recordset? I've tried
    rst!Ora = Format("24:00", "hh:nn")
    but it doesn't work.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filling an ADO recordset with hours (2003)

    24:00 is not a valid time, it is 0:00 on the next day. For the others, you can use

    rst!Ora = #9:30:00 PM#
    rst!Ora = #6:30:00 AM#
    rst!Ora = #12:00:00 AM#

    (VBA and SQL use USA time format)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •