Print Page | Close Window

Years Shows with Decimal

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18313
Printed Date: 18 Apr 2024 at 12:30pm


Topic: Years Shows with Decimal
Posted By: stevetothink
Subject: Years Shows with Decimal
Date Posted: 21 Dec 2012 at 9:05am
I've written the following formula.
 
if month({ROTDividends.Vest Date})in [01,02,03]
then "Q1" & " - " & (Year ({ROTDividends.Vest Date}))
 
It current returns: Q1 - 2,011.00
I want it to return Q1 - 2011
 
Can anyone help me correct my code to format the year properly?
Thanks,
Steve



Replies:
Posted By: stevetothink
Date Posted: 03 Jan 2013 at 4:35am
Bump - can anyone help me with this?
 
Thanks


Posted By: hilfy
Date Posted: 04 Jan 2013 at 7:59am
Try changing the formula to this:
 
if month({ROTDividends.Vest Date})in [01,02,03]
then "Q1" & " - " & ToText(Year ({ROTDividends.Vest Date}), 0, "")
 
This will format the year as a string without the comma or decimal.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: stevetothink
Date Posted: 09 Jan 2013 at 5:04am
Awesome - thanks for your help. I really appreciate it.
 
Steve



Print Page | Close Window