Format

  • Thread starter Thread starter Roger Bell
  • Start date Start date
R

Roger Bell

I have used an expression in a query as follows:
Expr2: (Now()-[COMMENCEMENT DATE OTHER])/7
The result appears as example: 89.88999
I would like the result to be rounded to the whole number eg: 90
Can I use the Format function as part of the expression, and if so, how
would I word this?

Many thanks for any help
 
Roger Bell said:
I have used an expression in a query as follows:
Expr2: (Now()-[COMMENCEMENT DATE OTHER])/7
The result appears as example: 89.88999
I would like the result to be rounded to the whole number eg: 90
Can I use the Format function as part of the expression, and if so, how
would I word this?

Many thanks for any help

Try using the CInt function.

Keith.
www.keithwilby.co.uk
 
I have used an expression in a query as follows:
Expr2: (Now()-[COMMENCEMENT DATE OTHER])/7
The result appears as example: 89.88999
I would like the result to be rounded to the whole number eg: 90
Can I use the Format function as part of the expression, and if so, how
would I word this?

Many thanks for any help

If you're trying to calculate the number of weeks since [COMMENCEMENT DATE
OTHER] to the present, try

Expr2: DateDiff("ww", [COMMENCEMENT DATE OTHER], Date())

Note that Now() returns the current date and time accurate to the second, and
that dividing a number by 7 will usually give a noninteger.
 
Back
Top