Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Remove decimals in formula

Remove decimals in formula

Remove decimals in formula


My formula is the following DatePart('ww',{mydatefield}) which shows me my weeks.

However I get 3.00 and I want 3 instead. I can't seem to use the decimal buttons to remove the zeros.

Can anyone help me figure this out.

Any help would be greatly appreciated.



RE: Remove decimals in formula

Try This

RE: Remove decimals in formula

Thanks Swiss,

It worked except when I group by the formula it sorts week 10, 11, etc before week 2.

Any ideas



RE: Remove decimals in formula

If you are listing the formula on your report, then you should be able to right click on the formula -> format field and apply the format you want such as -1123 which does not have the decimals  

RE: Remove decimals in formula

i think you can also use "Replace" to strip the decimal part,

RE: Remove decimals in formula

Thanks KsKid,

Yeah that worked. The decimal buttons were greyed out but when I right clicked it I could format it to remove the decimal places.

The only thing which is minor is that I still get decimals in the group tree (not on the actual report group names which no longer have decimals). However I can live with that (I didn't get the decimals anywhere with the totext however the sorting was a problem).

Tx again


RE: Remove decimals in formula

If the decimalised group tree figures are annoying you then you can amend them easily.

Right click on the group and choose change group.
Click on Options -> Customise -> Use formula as...
Click on the x+2 button and enter:


Or if a string is required then just




CR8.5 / CRXI - Discovering the impossible

RE: Remove decimals in formula



That will give you leading zeros.

yinyang Madawc Williams (East Anglia, UK).  Using Windows XP & Crystal 10 yinyang  

RE: Remove decimals in formula

Thanks this worked (with the leading zeros)


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close