Formatting numbers and dates in mixed content text boxes 
Author Message
 Formatting numbers and dates in mixed content text boxes

How do I format numbers or dates in a mixed content text box?

If I calculate an average, it's currently reported to 10 decimal places.  An
example of the code I'm using is:

="The average was therefore " & Avg([OBDs less Leave]) & " days."

I've tried using the control's properties, but this doesn't work.

Can anyone help?  Or am I going about this the wrong way?...

Thanks

Richard Moore



Tue, 26 Aug 2003 20:41:45 GMT  
 Formatting numbers and dates in mixed content text boxes
Off the top of my head, to 2 decimal places ...

="The average was therefore " & format(Avg([ODDs less Leave]),"#.00")
& " days."

Try it.

Fred


Quote:
> How do I format numbers or dates in a mixed content text box?

> If I calculate an average, it's currently reported to 10 decimal
places.  An
> example of the code I'm using is:

> ="The average was therefore " & Avg([OBDs less Leave]) & " days."

> I've tried using the control's properties, but this doesn't work.

> Can anyone help?  Or am I going about this the wrong way?...

> Thanks

> Richard Moore



Tue, 26 Aug 2003 23:41:41 GMT  
 Formatting numbers and dates in mixed content text boxes
Richard, check out the "Int" function.  I think that's what you're looking
for.

ed


Quote:
> How do I format numbers or dates in a mixed content text box?

> If I calculate an average, it's currently reported to 10 decimal places.
An
> example of the code I'm using is:

> ="The average was therefore " & Avg([OBDs less Leave]) & " days."

> I've tried using the control's properties, but this doesn't work.

> Can anyone help?  Or am I going about this the wrong way?...

> Thanks

> Richard Moore



Fri, 29 Aug 2003 23:39:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Date formatting when mixed with text

2. Stripped formatting from numbers in text box combining text and fields

3. mixing integer and text in a text box

4. Format the contents of a text box

5. Formatting Contents of a Text Box

6. Data Access Pages - How to condition a text box format based on its content

7. Storing the text content of a combo box, not the index number

8. Using text boxes to enter a date range to control subform contents

9. How to format text boxes in a horizontal line dependent on each text boxes length

10. combining data from two text boxes to create a date in a third text box


 
Powered by phpBB® Forum Software © phpBB Group