SQL Server Performance

string length is less than 0 or not an integer

Discussion in 'SQL Server Reporting Services' started by resty_maligaya, Oct 6, 2005.

  1. resty_maligaya New Member

    i got an error message "string length is less than 0 or not an integer" during reading records on my sub report.

    here's my codes:

    Initialization
    WhilePrintingRecords;
    stringVar gGoods;

    WhilePrintingRecords;
    stringVar gGoods;
    Right(gGoods, Len(gGoods)-1)

    Thanks for your help
  2. benwilson New Member

    I would say the error is in this line:
    Right(gGoods, Len(gGoods)-1)

    if LEN(gGoods) = 0 and you subtract 1 then you will get a negative number! so your line of code may end up looking like this:

    Right(gGoods, -1)

    which doesnt make sense


    'I reject your reality and substitute my own' - Adam Savage
  3. ranjitjain New Member

    yes you should check for len(gGoods)>0 condition and if true perform right function.

Share This Page