SQL Report Builder

  • Hi,

    Not sure where to put this...

    Im working in SQL Report Builder (sorry dont know which version) and am having trouble with calculated fields.

    Ive got 2 datasets - one with some tenancy information in it (DataSet1) and the other with address data in it (DataSet2)

    Ive got a calculated field that ive called "DaysVoid" which is essentially one date subtracted by another.

    I want to work out the total sum of all of the "DaysVoid" so have set up another calculated field which is called "TotalDaysVoid" //=sum(DaysVoid)\\ but when I run my query, I get the following error;

    //The Value expression for the textrun ‘Textbox34.Paragraphs[0].TextRuns[0]’ contains an error: [BC30451] Name 'DaysVoid' is not declared.\\

    Can anybody help?

  • Try using the following expression in textbo34:

    =sum(Fields!DaysVoid)

  • Thanks for your help - it worked! However....

    It now brings back the value (in this case 111) as a weird format;

    111.00:00:00

    Ive formatted the number right, and the globalization settings are en-GB... is there something I have missed?

    Thanks Again

  • is the text box property set to date time ?

  • Hi.

    No, it is set to Number.

    Also, the answer to my first question that I said it worked - actually didnt.

  • Possibly try CInt(sum(Fields!DaysVoid, "dataset_name") ) - assuming daysvoid is calculated as part of the query ?

  • No, it isnt - I think thats what the problem is.

    In my dataset, i have "Start Date" and "End Date"

    DaysVoid is a calculation of "End Date" subtract "Start Date"

  • try

    DateDiff("dd",Fields!StartDate.Value,Fields!StartDate.Value) to get the days void

  • sorry that should read

    DateDiff("dd",Fields!StartDate.Value,Fields!ENDDate.Value) to get the days void

  • Nope... afraid not. Just get #error

  • Hi Mark,

    We need more information in order to help you. Will you post your query and also a print screen of your dataset?

    Thanks,

    Sarah

  • Here we go...

  • Oh.. scrap that - I have to upload the images to web prior to posting them on here... I'll have to do that at home!

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply