Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula to make date format Post Reply Post New Topic
Author Message
csmith78
Newbie
Newbie


Joined: 21 Aug 2015
Online Status: Offline
Posts: 1
Quote csmith78 Replybullet Topic: Formula to make date format
     Posted: 21 Aug 2015 at 9:53am
I will start off by saying that I am a complete newbie at Crystal. I have only run them - never edited, built, etc.

I have a report with a subreport that has been working for years. It is on an old computer that I am trying to get rid of. So, I saved the report in a shared directory, and opened it on the new computer that also has Crystal Reports. The report opens fine - connects to the database, etc. HOWEVER, the subreport contains a column that displays the year/month. It is now displaying that column as 2,015.00/07.

I can't just change the format, because this information is pulled from the database and is its own formula. And when I compare this one to the one that works on the old computer, they are identical.

The formula is:

{Clnt_Recov_Stats.CLIENT_NUM} = {?Pm-Clnt_Recov_Stats.CLIENT_NUM} and
(If {?Pm-?MonthPrompt} < 6
Then ((({?Pm-?YearPrompt}-2)*100) + {?Pm-?MonthPrompt}+7) <=
     (({Clnt_Recov_Stats.FOUR_DIGIT_YEAR}*100) + ToNumber({Clnt_Recov_Stats.STAT_MONTH})) and
     (({?Pm-?YearPrompt}*100)+ {?Pm-?MonthPrompt}) >=
     (({Clnt_Recov_Stats.FOUR_DIGIT_YEAR}*100) + ToNumber({Clnt_Recov_Stats.STAT_MONTH}))
Else ((({?Pm-?YearPrompt}-1)*100) + {?Pm-?MonthPrompt} - 5)  <=
     (({Clnt_Recov_Stats.FOUR_DIGIT_YEAR}*100) + ToNumber({Clnt_Recov_Stats.STAT_MONTH})) and
     (({?Pm-?YearPrompt}*100)+ {?Pm-?MonthPrompt}) >=
     (({Clnt_Recov_Stats.FOUR_DIGIT_YEAR}*100) + ToNumber({Clnt_Recov_Stats.STAT_MONTH}))) and
(({Clnt_Recov_Stats.FOUR_DIGIT_YEAR}*12)+ ToNumber ({Clnt_Recov_Stats.STAT_MONTH}) + {Clnt_Recov_Stats.REC_STAT_OFFSET})
<= (({?Pm-?YearPrompt}*12) + {?Pm-?MonthPrompt})

How can I get this to display in the right format? I have a smaller formula in a different section that does the same thing. That formula is:

{?MonthPrompt} & "/" & {?YearPrompt}

Any help would be greatly appreciated!

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 4:44am
your first formula looks like a select formula,
the second formula looks like a string used to display.
You may want to look more closely at the existing field on the report canvas to see if it has any display formula applied to it.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum