Is it possible to string "Int" datatypes together?

  • Hello,

    I have 2 datatypes that are Int that I need to put in the same field with a hyphen in between. I tried the following: =First(Fields!TaxFrom.Value, "CityCollection")& "-" & First(Fields!TaxTo.Value, "CityCollection") and it failed.

    Thanks,

    George

  • You'll need to convert to strings first.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • If you could explain how to convert to Strings within SSRS that would be helpful 😀 as I am not entirely sure how to go about that.

    Thanks,

    George

  • I did an online search (Bing in this case) for "data type conversion ssrs", and the first hit was http://msdn.microsoft.com/en-us/library/cc281083.aspx. The second subhead on the page is "Converting Dataset Fields to a Different Data Type", which outlines how to do that, including an example for CStr, which is the conversion function to turn something into a string.

    Does that help?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Yes it does thank you. I do have an odd issue though. My code is as follows =Cstr(Fields!TaxFrom.Value) & "-" & Cstr(Fields!TaxTo.Value) . For some reason ONLY the "-" and the second value are showing up even though both values exist. Any idea?

  • No clue on that one. Try padding it with a zero-length string before it, maybe?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hi,

    Use ur own custome code(vb script) to get the desired output.I just thinking "cstr" will work the same but not sure ,why its not working in u r requirment.

    Thanks

    Veeren

    Thanks & Regards,
    Veeren.
    Ignore this if you feel i am Wrong. 😉

  • I got it all figured out. I neglected to use the correct scope which resulted in the failure. Thanks all for your help.

  • You're welcome.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 9 posts - 1 through 9 (of 9 total)

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