0

I am totaling all open dates and all closed dates then taking the difference.

This is the expression I have that is not working for me. =Avg(DateDiff("d",Fields!Opened_Date.Value, Fields!Closed_Date.Value))

It just displays error on the report in the expression field.

I've attached an image of my dataset along with the form and highlighted part of where my expression needs to be.

I'm trying to average the days between open and close date fields but need to first calculate the difference between the two fields and then average. There are thousands of rows in this report, and I need it to function for my manufacturer team.

  • could you try to use day (not quotation) insted of "d" ? Here is the code: Avg(DateDiff(day,Fields!Opened_Date.Value, Fields!Closed_Date.Value)) in SQL server, datediff() parameter accepts day, instead of a 'd' string. see https://www.w3schools.com/sql/func_sqlserver_datediff.asp – Junjie Mar 06 '23 at 18:35
  • If I run that without quotations and the day I get this The Value expression for the textrun ‘Textbox24.Paragraphs[0].TextRuns[0]’ contains an error: [BC30455] Argument not specified for parameter 'DateValue' of 'Public Function Day(DateValue As Date) As Integer'. – lovelydeatheater Mar 06 '23 at 19:07
  • Are those date field actually date or datetime datatypes? I think your expression should work if they are. and `"d"` is correct ion SSRS expressions (or you can use the explicit `DateInterval.Day` instead but both should work. Check you datatypes and check if there is more detail in the error pane in VS – Alan Schofield Mar 06 '23 at 19:48
  • I'm not using VS. I'm using ssrs. The date fields are the values from the query opened_date exists on the forms im pulling – lovelydeatheater Mar 07 '23 at 14:20

0 Answers0