Check against time value for conditional formatting

G

Guest

I need to be able to check against a time value in conditional formatting so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
G

Guest

Thank you, but I have already tried this and am getting strange results. i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time value?

The field being checked is a calculated field containing the result of one
time value subtracted from another and is displayed as :0015, 02:10, 00:45,
03:45. I need to be able to highlight the one which is over threee hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

Duane Hookom said:
Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


Wyndham said:
I need to be able to check against a time value in conditional formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
D

Duane Hookom

Use DateDiff("H", [StartTime], [EndTime]) to calculate your time difference.
You can then compare to 3.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
Thank you, but I have already tried this and am getting strange results.
i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time value?

The field being checked is a calculated field containing the result of one
time value subtracted from another and is displayed as :0015, 02:10,
00:45,
03:45. I need to be able to highlight the one which is over threee
hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

Duane Hookom said:
Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


Wyndham said:
I need to be able to check against a time value in conditional
formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
G

Guest

I don't want to get frustrated with somone who is trying to help, but!!

I have already indicated that the time difference calculation is already
working and gave examples of the results. I have also said that comparing
against "3" does not work. It brings up unexpected results. i.e. it
highlights the wrong results.

What do I need to do to get this working? Not sure if it matters but I am
using Access 2000.

.................................................................................................................

Duane Hookom said:
Use DateDiff("H", [StartTime], [EndTime]) to calculate your time difference.
You can then compare to 3.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
Thank you, but I have already tried this and am getting strange results.
i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time value?

The field being checked is a calculated field containing the result of one
time value subtracted from another and is displayed as :0015, 02:10,
00:45,
03:45. I need to be able to highlight the one which is over threee
hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

Duane Hookom said:
Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


I need to be able to check against a time value in conditional
formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
D

Duane Hookom

I don't want to get frustrated either but I told you in my first reply to
compare to 0.125 rather than 3.

Since you insisted on using 3 rather than 0.125, I thought I would show you
how you could use 3.

A value of 1 equals 1 day. A value of .5 equals 12 hours. A value of 0.125
equals 1/8th of a day or 3 hours.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
I don't want to get frustrated with somone who is trying to help, but!!

I have already indicated that the time difference calculation is already
working and gave examples of the results. I have also said that comparing
against "3" does not work. It brings up unexpected results. i.e. it
highlights the wrong results.

What do I need to do to get this working? Not sure if it matters but I am
using Access 2000.

...............................................................................................................

Duane Hookom said:
Use DateDiff("H", [StartTime], [EndTime]) to calculate your time
difference.
You can then compare to 3.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
Thank you, but I have already tried this and am getting strange
results.
i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time
value?

The field being checked is a calculated field containing the result of
one
time value subtracted from another and is displayed as :0015, 02:10,
00:45,
03:45. I need to be able to highlight the one which is over threee
hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

:

Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


I need to be able to check against a time value in conditional
formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
G

Guest

As you hadn't explained what the 0.125 represented it seemed like you were
showing me the basic syntax and not that I should use this instead of 3.

Is there anywhere I can find out more about this? e.g. usie 0.125 instead of
3, etc

Many thanks.

Duane Hookom said:
I don't want to get frustrated either but I told you in my first reply to
compare to 0.125 rather than 3.

Since you insisted on using 3 rather than 0.125, I thought I would show you
how you could use 3.

A value of 1 equals 1 day. A value of .5 equals 12 hours. A value of 0.125
equals 1/8th of a day or 3 hours.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
I don't want to get frustrated with somone who is trying to help, but!!

I have already indicated that the time difference calculation is already
working and gave examples of the results. I have also said that comparing
against "3" does not work. It brings up unexpected results. i.e. it
highlights the wrong results.

What do I need to do to get this working? Not sure if it matters but I am
using Access 2000.

...............................................................................................................

Duane Hookom said:
Use DateDiff("H", [StartTime], [EndTime]) to calculate your time
difference.
You can then compare to 3.

--
Duane Hookom
MS Access MVP
--

Thank you, but I have already tried this and am getting strange
results.
i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time
value?

The field being checked is a calculated field containing the result of
one
time value subtracted from another and is displayed as :0015, 02:10,
00:45,
03:45. I need to be able to highlight the one which is over threee
hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

:

Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


I need to be able to check against a time value in conditional
formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 
D

Duane Hookom

There are a number of Date/Time links at
http://www.mvps.org/access/datetime/index.html.

It isn't that difficult once you get your head around the fact that 1 equals
a day. 1/24= hour. 6 hours = .25.
There are lots of functions that allow you to work with different date and
time intervals such as: DateDiff(), Month(), DateSerial(), DateAdd(),
Format(), Year(),...

--
Duane Hookom
MS Access MVP


Wyndham said:
As you hadn't explained what the 0.125 represented it seemed like you were
showing me the basic syntax and not that I should use this instead of 3.

Is there anywhere I can find out more about this? e.g. usie 0.125 instead
of
3, etc

Many thanks.

Duane Hookom said:
I don't want to get frustrated either but I told you in my first reply to
compare to 0.125 rather than 3.

Since you insisted on using 3 rather than 0.125, I thought I would show
you
how you could use 3.

A value of 1 equals 1 day. A value of .5 equals 12 hours. A value of
0.125
equals 1/8th of a day or 3 hours.

--
Duane Hookom
MS Access MVP
--

Wyndham said:
I don't want to get frustrated with somone who is trying to help, but!!

I have already indicated that the time difference calculation is
already
working and gave examples of the results. I have also said that
comparing
against "3" does not work. It brings up unexpected results. i.e. it
highlights the wrong results.

What do I need to do to get this working? Not sure if it matters but I
am
using Access 2000.

...............................................................................................................

:

Use DateDiff("H", [StartTime], [EndTime]) to calculate your time
difference.
You can then compare to 3.

--
Duane Hookom
MS Access MVP
--

Thank you, but I have already tried this and am getting strange
results.
i.e.
the result is not what I expect.

Do I need to enter a special numeric value that represents the time
value?

The field being checked is a calculated field containing the result
of
one
time value subtracted from another and is displayed as :0015, 02:10,
00:45,
03:45. I need to be able to highlight the one which is over threee
hours....

Should the "comparator" be "3" for three hours or something else - I
understand Access stores time values in a special way....

:

Try something like
Expression is
[TimeField] <0.125

--
Duane Hookom
MS Access MVP


I need to be able to check against a time value in conditional
formatting
so
I can set the relevant field to bold.

e.g. if "field" is greater than 3 hours, etc

Using a "simple" numeric value produces odd results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top