Tuesday, February 14, 2012

DateAdd narrowing conversion error

I am simply trying to take a date and add the value from another field to it using the following expression:

=dateadd("d", " & Fields!new_tgddatefrom.Value & ", Parameters!HolidayDate.Value)

new_tgddatefrom.Value is an int data type
HolidayDate.Value is a date


The expression works fine if I use an acutal number for the value to add but when I use the field.value I get an error:

Overload resoution failed because no accessible 'DateAdd can be called without a narrowing conversion.

Why or why is it so difficult to work with dates!?!? If anyone can help me get this working I would sincerely appreciate it!

Debra

Debra:

The multiplier in the dateadd function must be an integer and since you say the field value is one why concatenate the quotes?

=dateadd("d", Fields!new_tgddatefrom.Value, Parameters!HolidayDate.Value)

Petr|||Dear
Plz check date type of date interval, both date should be date type.
Thanks
Manoj Singh

No comments:

Post a Comment