Sheva07 Sheva07 - 4 months ago 62
C# Question

How to add Date in crystal Report c#

in my app I am showing a date in my crystal report and I have a column which is the number of months but it is a text in my database.
So, I create a formula field where I do the addition of the date and the month in order to get the new value of the date but I got an error telling me that the field is not numerical.

Here is my code to add the date

CDate(DateAdd ("M",ToNumber({TableName.interval}) ,{} ))

TableName.interval is of type text and is of type Date in my database.


Try to remove the CDate function I guess it will also work. Your final fomrula must look like:

DateAdd ("m",ToNumber({TableName.interval}),{} )