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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I Change char field to year field

Status
Not open for further replies.

davefm1

Programmer
Apr 18, 2001
78
US
HI, all,
I was wondering can I can a char field like 01 Jan 02 (char9) over to a year field 02 in a crystal fromula field year so I can group fields by.
HOW DO YOU DO THIS


THANKS
DAVE
 
You have a few options here:

val(right(01 Jan 02,2))+2000 will return 2002, which is suitable for years beyond 1999, but I would suggest that you convert the text to a formula containing a date:


// @MyDate
cdate({MyTable.MyDateField})

Now use this formula to group by (you can set groups on dates to be by the year using the The Section Will Be Printed set to for each year in the grouping dialog).

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top