Displaying numbers less than 0 as 0 on a Form or Query

Bill Bisco

Custom User Title
Local time
Today, 00:31
Joined
Mar 27, 2009
Messages
92
Dear all,

I have a continuous form which displays the results of my query. In my query I calculate the "Slack time" for an assembly line, or the time in which no one is working. Sometimes I will calculate a negative slack, meaning that they are working constantly and cannot be expected to produce the expected results without overtime.

As such, it would be better in the the text box to say "0 Slack time" rather than "-18.2 Slack Time"

Any ideas as to how to achieve this?

Any help is appreciated,
Bill
 
Hi

You don't say how you calculate the Slack Time but if you have a field in your query that returns -18.2 then you could use something like:

ST:IIF([Slack Time] < 0, 0, [Slack Time])

Where Slack Time is the name of a field in your query that returns -18.5
 
It is rather odd that you are returning a string like "-18.5 Slack Time" as the result. Normally I would expect just a number in a control called Slack Time.

If you really do have a string then bob's code won't work.

If it is a number than the display can be changed with the Format property of the control. This Format property will cause any value of zero or less to be displayed as zero.

Code:
&;"0";"0"

The field supplying the date must be a numeric datatype.
 

Users who are viewing this thread

Back
Top Bottom