Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

gogopoppy (Instructor) (OP)
8 Oct 08 15:32
Hi,

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.

Tx

G
Helpful Member!  swiss2007 (TechnicalUser)
8 Oct 08 16:09
Try This
totext(DatePart('ww',{mydatefield}),0,"")
gogopoppy (Instructor) (OP)
8 Oct 08 16:27
Thanks Swiss,

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

Any ideas

Tx

G
Helpful Member!  kskid (TechnicalUser)
8 Oct 08 16:40
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  
bond24 (Programmer)
8 Oct 08 16:47

i think you can also use "Replace" to strip the decimal part,
 
gogopoppy (Instructor) (OP)
8 Oct 08 16:49
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

G
Helpful Member!  CR85user (TechnicalUser)
9 Oct 08 4:57
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:

val(totext({table.field},0,''))

Or if a string is required then just

totext({table.field},0,'')


'J

 

CR8.5 / CRXI - Discovering the impossible

Helpful Member!  Madawc (Programmer)
9 Oct 08 5:42
Or

CODE

totext(DatePart('ww',{mydatefield}),"00")
That will give you leading zeros.

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

gogopoppy (Instructor) (OP)
9 Oct 08 20:39
Thanks this worked (with the leading zeros)

G

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