开发者

crystal code programming erro

what is wrong with this formula

IF {@year2 number} = 2013 And {@Current Month}='Jan' THEN '- 12' ELSE '- 13'
IF {@year2 number} = 2012 And {@Current Month}='Jan' THEN '- 11' ELSE '- 12'
IF {@year2 number} = 2011 And {@Current Month}='Jan' THEN '- 10' ELSE '- 11'
IF {@year2 number} = 2010 And {@Current Month}='Jan' THEN '- 09' ELSE '- 10'
IF {@year2 number} = 2009 And {@Current Month}='Jan'THEN '- 08' ELSE '- 09'
IF {@year2 number} = 2008 And {@Current Month}='Jan' THEN '- 07' ELSE '- 08'
IF {@year2 number} = 2007 And {@Current Month}='Jan' THEN '- 06' ELSE '- 07'
IF {@year2 number} = 2006 And {@Current Month}='Jan' THEN '- 05' ELSE '- 06'
IF {@year2 number} = 2005 And {@Current Month}='Jan' THEN '- 04' ELSE '- 开发者_如何学JAVA05'
IF {@year2 number} = 2004 And {@Current Month}='Jan' THEN '- 03' ELSE '- 04'
IF {@year2 number} = 2003 And {@Current Month}='Jan' THEN '- 02' ELSE '- 03'
IF {@year2 number} = 2002 And {@Current Month}='Jan' THEN '- 01' ELSE '- 02'
IF {@year2 number} = 2001 And {@Current Month}='Jan' THEN '- 00' ELSE '- 01'
IF {@year2 number} = 2000  And {@Current Month}='Jan'THEN '- 99' ELSE '- 00'
IF {@year2 number}= 1999 And {@Current Month}='Jan' THEN '- 98' ELSE '- 99'
IF {@year2 number} = 1998 And {@Current Month}='Jan' THEN '- 97' ELSE '- 98'


Welcome to SO, user525552,

Relax. You can get rid of the formula entirely. Drag & drop your date field onto your report design, then right-click->format field->date and time and pick your preferred display format.

Edit

Based on your comment, try this formula. (I'm not convinced you actually need this formula, but this does answer your immediate question)

Monthname(
    month(
        DateAdd ("m", -4, {?Pm-Command.SCHED_END_DT})
    )
,true)

& "-" &

right(
    cstr(
        year(
            DateAdd ("m", -4, {?Pm-Command.SCHED_END_DT})
        )
    ,0,"")
,2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜