Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

How can I preserve display string (convert DOB to Age) upon excel export?

$
0
0

I am using the following code to convert DOB to age within Display String (Format Field/Common tab):

 

if
//months
(datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1))<2 then
totext(datediff('mm',{CDCLIENT.DOB},currentdate),0,'') & ' months'
else
//years
totext((datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1)),0,'') //& ' years'

When I export to excel/csv/ttx.. it doesn't export the display string (Age), but reverts back to the DOB. How do I preserve this upon export?


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>