Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8640

Broken CStr function in Crystal Reports

$
0
0

Hello Everyone,

 

I have a new weird issue.  I have a formula that has been working fine until yesterday.

 

The db I am querying is using a year month string to query a database.  So I created the following code to convert a calculated date into the string I needed.  It has been working fine until yesterday. 

 

Here is the code I am using

 

{?Date} = inputted date

{@Date.4} = calculated date

{@Date_4} = the string of yyyymm I need for the querry/

 

Formula "Date.4":  DATE (DateAdd ("m",-4 ,{?Date}))

 

Formula "Date_4":

 

if MONTH({@date.4}) < 10 then CStr (YEAR ({@date.4})) & '0' & CStr (MONTH ({@date.4})) else CStr (YEAR ({@date.4})) & CStr (MONTH ({@date.4}))

 

the formula is returning "2016.0003.00"

It used to return "201603" (and that is what I need)

 

Can you see why this might be returning the wrong values?


Viewing all articles
Browse latest Browse all 8640

Trending Articles



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