hospital arrival time - find hour from TIME and day of the week from DATE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nex85
    New Member
    • Oct 2006
    • 4

    hospital arrival time - find hour from TIME and day of the week from DATE

    hi!
    HOUR FROM TIME
    i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

    DAY OF THE WEEK FROM DATE IN VBA
    ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

    APPEND DATE AND DATE STRING
    iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

    ~thank you soo much for the help!
  • pureenhanoi
    New Member
    • Mar 2007
    • 175

    #2
    Originally posted by nex85
    hi!
    HOUR FROM TIME
    i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

    DAY OF THE WEEK FROM DATE IN VBA
    ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

    APPEND DATE AND DATE STRING
    iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

    ~thank you soo much for the help!
    + to get Hour, Minute, Second from time value, you can use these functions:
    hh = Hour(yourTimeVa lue) or hh = Hour(TimeValue( "17:00:26") )
    mm= Minute(yourTime Value)
    ss = Second(yourTime Value).
    + to convert full-timevalue to short time value, you can use Format function
    shortTime = Format(timeValu e,"hh:mm")
    + to get day of week, use this function
    weekday(Date) will return day in number
    weekdayName(wee kday(Date)) will return day name (Sunday,Monday. ..)
    if you need short format of day name, you can use an array to store dayname, and use index = Weekday(Date) to determine dayname
    dayName = DayNameArray(in dex)
    + to combine dayname with date variable, you can use string concate
    fullDayName = Date & " " & dayName

    Comment

    • vijaydiwakar
      Contributor
      • Feb 2007
      • 579

      #3
      Originally posted by nex85
      hi!
      HOUR FROM TIME
      i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

      DAY OF THE WEEK FROM DATE IN VBA
      ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

      APPEND DATE AND DATE STRING
      iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

      ~thank you soo much for the help!
      use format function like
      MsgBox Format(Now, "HH:MM")
      format(date,"dd dd dd/mm/yyyy")
      try it good luck

      Comment

      Working...