By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,183 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,183 IT Pros & Developers. It's quick & easy.

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

P: 4
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!
Mar 29 '07 #1
Share this Question
Share on Google+
2 Replies


pureenhanoi
100+
P: 175
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(yourTimeValue) or hh = Hour(TimeValue("17:00:26"))
mm= Minute(yourTimeValue)
ss = Second(yourTimeValue).
+ to convert full-timevalue to short time value, you can use Format function
shortTime = Format(timeValue,"hh:mm")
+ to get day of week, use this function
weekday(Date) will return day in number
weekdayName(weekday(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(index)
+ to combine dayname with date variable, you can use string concate
fullDayName = Date & " " & dayName
Mar 29 '07 #2

vijaydiwakar
100+
P: 579
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,"dddd dd/mm/yyyy")
try it good luck
Mar 29 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.