Hi,
I'm sure this has been done before, but I can't seem to find this one on the net....
I have a datefield but instead of it just displaying:
07/12/18 08:30
I would like to display it as: 07/12/18 MORNING
or when it's 07/12/18 12:00 as: 07/12/18 NOON
and 07/12/18 14:30 as: 07/12/18 AFTERNOON
From 00:00 till 11:30 = MORNING
from 11:30 till 13:30 = NOON
from 13:30 till 17:00 = AFTERNOON
Can someone plz help me with this?
Thanks alot in advance!
Joachim
9 2202
Hi,
Extract the TimePart from the Date, Use a "Select Case" or "IF" condtion to print the Day Part..
REgards
Veena
You simply need to extract the time part only anc compare as per youir range and display accordingly.
Hi,
Extract the TimePart from the Date, Use a "Select Case" or "IF" condtion to print the Day Part..
REgards
Veena
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.EstimatedTime()) < 11 Then
-
TimeOfDay = "Voormiddag"
-
End if
-
-
If TimeValue(Me.EstimatedTime()) =>11 AND TimeValue(Me.EstimatedTime()) < 13 Then
-
TimeOfDay = "Middag"
-
End if
-
-
If TimeValue(Me.EstimatedTime()) => 13 Then
-
TimeOfDay = "Namiddag"
-
End if
-
End Function
But it doesn't work ....
Can you help me plz?
Thanks.
you need to capture only the hour from time part in 24 hrs format and compare the same in a simple select case and display as desired.
you need to capture only the hour from time part in 24 hrs format and compare the same in a simple select case and display as desired.
Sorry, but i'm a real newbie.
Can you help me with the code please?
Thanks ....
Hi,
Dont Use, TimeValue ...
Use Hour(MyDate) in your TimeOfDay function..
REgards
Veena
Do not post duplicate threads or send PM to anyone it is strictly against forum rules. Do as sugested by our expert in the previous post.
Hi,
Dont Use, TimeValue ...
Use Hour(MyDate) in your TimeOfDay function..
REgards
Veena
Thank you so much! It works!! :)
Do not ... send PM to anyone it is strictly against forum rules
This is a valid point, but comes across in this post as a slight exaggeration. I'd just like to clarify.
It is not "strictly against forum rules" to send anyone a PM. Private Messages are often used to chat "off list" to avoid cluttering up the discussion forum. But for technical questions and answers we want everything in the forum so it's available for later reference. TheScripts is all about the free exchange of information, so discussing these things in private goes against that ideal.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andrew |
last post by:
Hi,
I select from an Access table " where date >= '3/1/2004' and date
<='3/31/2004' ", but no record. Can you tell me how to make this
comparission?
Thanks
--
Andrew
|
by: goochey |
last post by:
I'm trying to convert a Julian Date (Format "4365") into an actual calendar
date in Visual Basic, can anyone help me out with this.
|
by: clintonG |
last post by:
When the following code is run on Sat Dec 25 2004 19:54:18 GMT-0600 (Central
Standard Time)
var today = new Date();
var GMTDate = today.toGMTString();
document.write("GMTDate: " + GMTDate);
...
|
by: Macca |
last post by:
Hi,
I have a table which has a date/time field. I am storing them as follows :-
01/01/2005 11:25
01/01/2005 19:44
02/01/2005 05:04
|
by: DP |
last post by:
hi,
i've got this peice of code;
<script language= "JavaScript">
var today = new Date();
var hourOfDay = today.getHours();
var message = " and welcome to MIS ";
if (hourOfDay >=0 &&...
|
by: magix |
last post by:
Hi,
Do you have any javascript available for changing images according to time ?
let say Morning (7am-12pm), using images 1 (e.g morning.jpg)
Afternoon (12 - 6pm), using images 2 (e.g...
|
by: mr.nimz |
last post by:
hello,
this is antenio. recently i've come to a problem. i got a way through
it, somehow, still it left me in a curious state, so i'm posting it
here, if i can get an answer from some techy,
...
|
by: ARC |
last post by:
Hello all,
General question for back-end database that has numerous date fields where
the database will be used in regions that put the month first, and regions
that do not.
Should I save a...
|
by: indefatigable |
last post by:
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |