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

Extract time and change in morning, noon, afternoon

P: 5
This is what I have:

Function Value

If Not IsNull(DeadLine) Then
If TimeValue(DeadLine) = 0 Then
Value = Format(DeadLine, "dd/mm/yyyy")
Else
If DateValue(DeadLine) = 0 Then
Value = Format(DeadLine, "hh:mm")
Else
Value = Format(DeadLine, "dd/mm/yyyy, hh:mm")
End If
Value = Value & " uur"
End If
Value = Value
End If

If Not IsNull(Me.EstimatedTime) Then
If Value > "" Then
Value = Value & ", "
End If
Value = Value & "duur ca." & Format(Me.EstimatedTime, "0.0#") & " uur."
End If

End Function




So I want to take the hour from this:

Function TimeOfDay()
If TimeValue(Me.DeadLine()) < 11 Then
TimeOfDay = "Morning"
End if

If TimeValue(Me.DeadLine()) =>11 AND TimeValue(Me.DeadLine()) < 13 Then
TimeOfDay = "Noon"
End if

If TimeValue(Me.DeadLine()) => 13 Then
TimeOfDay = "Afternoon"
End if
End Function



But it doesn't work ....

Can you help me plz?
Thanks.
Dec 18 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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