4

I want a simple formula which concatenates two values together separated by an em-dash. The formula would read something like the following:

{?PeriodFrom} & #em-dash-character# & {?PeriodTo}

Obviously, I just want the em-dash character to appear between the two period values. How can this be done?

4444
  • 3,541
  • 10
  • 32
  • 43
cartbeforehorse
  • 3,045
  • 1
  • 34
  • 49
  • I should add... I've tried the `ChrW()` function without success. I think the complexity might be that `em-dash` is a Unicode character??? – cartbeforehorse Aug 09 '16 at 10:25
  • 3
    found this: _In any software program that handles text, the em dash can be typed on an enhanced keyboard as Alt + 0151—that is, hold down the "alternate" key and type, using the numerical pad on the right side of the keyboard, the numbers 0151_. [here](http://www.getitwriteonline.com/archive/091502enem.htm) Can you copy/paste from Word to your report? – Beth Aug 09 '16 at 16:42
  • @Beth I tested this out in Crystal Reports. It does seem to work! Although the resulting character appears to be the same as the Horizontal Bar character. – 4444 Aug 09 '16 at 21:22
  • @Beth I tried that too, as I found the same kinds of resource online. However, the `Alt` thing doesn't seem to work for me. (Perhaps it's because I'm on a Lenovo laptop, with no number-pad: https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Notebooks/Special-characters-shortcuts-don-t-work/td-p/921069) – cartbeforehorse Aug 10 '16 at 09:16
  • 1
    @Beth Anyhow, I agree with 4444. Copy-pasting the character into the formula itself doesn't seem to work. I think 4444 has the correct answer below. I'm about to test... – cartbeforehorse Aug 10 '16 at 09:19

2 Answers2

0

You can use ― U+2015 Horizontal Bar

enter image description here

You also don't need to use a formula for this. If you create a Text Object you can actually drag
{?PeriodFrom} and {?PeriodTo} into the textbox and paste the Horizontal Bar between them:

enter image description here

Just keep in mind you have to drag the parameter fields into
the textbox. Manually typing in "{?PeriodFrom}" won't work.

4444
  • 3,541
  • 10
  • 32
  • 43
  • 1
    You're right. No need to over-use formulas. I'm still learning Crystal. Thanks for the lesson :-) – cartbeforehorse Aug 10 '16 at 13:57
  • No worries, I've been using it for years and I'm still learning! They made some... *interesting* choices when they wrote Crystal. – 4444 Aug 10 '16 at 13:58
0

Also found this:

Four ways to insert an em dash in a Word document
The easiest way to enter an em dash ( — ) is to let Word do it.  Simply enter two hyphen characters between the two words you want to connect, and Word will turn the hyphens into an em dash. If this doesn't work for you, one of two possibilities exist:
•   You've inserted space characters between the words and the hyphen characters. When you enter spaces between the hyphens, Word formats the hyphens as an en dash ( – ), which is shorter than an em dash.
•   Someone has disabled the AutoCorrect option that formats hyphens as an em dash.
Now, this default won't work for everyone every single time. If you occasionally need two hyphens instead of an em dash, you can press [Ctrl]+Z and Word willundo the em dash character and restore the hyphens. If you find yourself doing this a lot, it might be more efficient to disable the AutoCorrect option and enter an em dash, when you require it, manually. You can disable this option as follows:
1.  From the Tools menu, choose AutoCorrect Options.
2.  Click the AutoFormat As You Type tab.
3.  Uncheck the Hyphens ( — ) With ( — ) option. 
4.  Click OK.
After disabling the AutoCorrect option, you'll have to enter an em dash manually. Fortunately, there are three easy methods:
•   Press [Ctrl]+[Alt]+-. You must use the minus sign (-) on the numeric keypad; if you use the hyphen character on the alphanumeric keypad, Word will change the cursor.
•   Hold down the [Alt] key and type 0151 on the numeric keypad.
•   Choose Symbol from the Insert menu, click the Special Characters tab, highlight the em dash, and click Insert.

formatted nicely here

Beth
  • 9,531
  • 1
  • 24
  • 43