Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Date in Formula Edit to Year-Month

Status
Not open for further replies.

jotek

MIS
Oct 9, 2001
21
US
I have a formula which converts a Date to Year-Month (2001-10) which I am using to Group records. The formula is: Year(Delivery_Date)&Month(Delivery_Date). The problem is that the answer comes back as 2,0000.000010.0000

The only thing I know of is the number "Options" on the report is set to -1,123.0000 since number fields on our reports need to be this format. I have tried to convert ToText and a few other things such as truncate but the result is always the same. I guess I don't want to change the other 8 numberic fields just becuase of one field not converting properly.
(using CR 8.5)
 
Try something like:

Cstr(Year ({Delivery_Date}),0,'')&Cstr(Month({Delivery_Date}),0,'')

This would remove the decimal places and the
comma.

Cheers,
- Ido ixm7@psu.edu
 
You are very much appreciated. It worked like a charm!
 
There is an easier way. Set the group to the date field, and it will ask if you want to group by day, week, month, etc... The group name field will display accordingly.

HTH
LT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top