Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine 2 expression fields into one 1

Status
Not open for further replies.

Cooperdam

MIS
Oct 7, 2009
65
US
HI I have to take 2 Expression fields I made and combine them into one. It is simply 2 dates that are column headings, from and to dates. The from date is this:

=DateAdd("m",-4,DateAdd("d",1,Parameters!ENDDATE.Value))

and then the "to" date is this:

=DATEADD("d",-1,DateAdd("m",-3,DateAdd("d",1,Parameters!ENDDATE.Value)))

I am not sure how to combine them to be one Expression field, with some spaces between them of course.

Thank you for any help,
Coops
 
Actually, the "spaces between them" is going to be the most difficult part of this since it's been my experience that Reporting Services condenses multiple spaces into a single space. As to combining your 2 date fields, just change your expression to concatenate your 2 separate expressions:
Code:
=DateAdd("m", -4, DateAdd("d", 1, Parameters!ENDDATE.Value)) & "   " & DateAdd("d", -1, DateAdd("m", -3, DateAdd("d", 1, Parameters!ENDDATE.Value)))
The tricky part is the space(s) between the two dates. I've had success with typing in non-breaking spaces instead of simply hitting the space bar. To enter a non-breaking space, hold the Alt key while typing in 0160, then release the Alt key. Repeat this for each non-breaking space you want in you separator string. You may also copy and paste these non-breaking space values.
 
Dave, thanks, I was just noticing that, maybe to put a dash between them?
 
Yes, I usually use a dash " - " to separate items. As long as there's only a single space, there's no problem. It's just when there's consecutive spaces that they get condensed.

Also, if you're using SSRS2008, you may want to familiarize yourself with using Placeholders as these allow a great deal more flexibility when working with multiple values in a single textbox.
 
The other thing is, is it possible to have the 'heading' be a larger area, than the rest of the grid?
THe problem is that there is too much data for text box. I can lower the font but then they will complain - best would be if the one box can expand but not sure if this can be done?
 
Without seeing your current design, I couldn't say. Is there an available cell to the right of your heading text box? If so, maybe you can select them both and then merge them (right-click after selecting both, then Merge Cells).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top