| Author |
Message |
nkdata
Newbie
Joined: 30 Sep 2014
Online Status: Offline
Posts: 6
|

Topic: Formula Field to concatenate date and text Posted: 02 Oct 2014 at 8:30am |
|
I'm a newbie, it doesn't seem like it should be too hard, but I keep getting an error.
I need help to create a formula field in Crystal Reports 2008. I need the field to take the current year, if the "from date of service" is greater than or equal to 01/01/current year, it should enter the quarter of the service year (ex: 3 Qtr 2014). If the "from date of service" is less than the current year, it should enter CY + year of service (ex: CY 2012).
In excel it looks like this
IF(D1>=1/1/2014,INT(INT(MONTH(D1)+2)/3)&"-"&"QTR"&" "&TEXT(D1,"YYYY"),"CY"&"-"&TEXT(D1,"YYYY"))
where D1 is the cell containing the "from date of service"
Can you help???
|
|
new to this I NEED HELP
|
IP Logged |
|
|
|
nkdata
Newbie
Joined: 30 Sep 2014
Online Status: Offline
Posts: 6
|

Posted: 02 Oct 2014 at 10:08am |
|
How can I modify this
if Year({Command.FROMDATESVC}) = Year (CurrentDate) then INT(INT(MONTH({Command.FROMDATESVC})+2)/3) else Year ({Command.FROMDATESVC})
to add the "Qtr" or "CY" text??
|
|
new to this I NEED HELP
|
IP Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|

Posted: 07 Oct 2014 at 8:28am |
|
You did not state whether you wanted the Qtr or CY before or after the number, but basically you need probably do a totext function (i.e., totext(INT(INT(MONTH({Command.FROMDATESVC})+2)/3),0) ), then just add the text (i.e., totext(INT(INT(MONTH({Command.FROMDATESVC})+2)/3),0) + " Qtr" )
|
IP Logged |
|
|
|