0

i want to combine two column in drop-down list and need result from sql.i have already try with putting space between two value but not get proper alignment.

i need result like below.

TRAVEL      |     Travel Rate
PAINT       |     PAINT
MOTEL       |     Motel Rate
Labor1      |     Mobilization Labor

i try with following query.

 SELECT ItemID  + SPACE(12 - len(ItemID)) + '|'  + Description
FROM InventoryMaster

but get this result

TRAVEL      |Travel Rate
PAINT     |PAINT
MOTEL       |Motel Rate

Thanks in advance.

Incognito
  • 2,964
  • 2
  • 27
  • 40
Parin Parikh
  • 44
  • 1
  • 6
  • 1
    Have a look at this usage of RIGHT & LEFT padding: http://stackoverflow.com/questions/12501038/right-pad-a-string-with-variable-number-of-spaces – RST_7 Feb 26 '14 at 08:40

2 Answers2

0

As @RST_7 wrote:

SELECT LEFT (ItemID + SPACE (12), 12) + '|     '  + Description
FROM InventoryMaster
GriGrim
  • 2,891
  • 1
  • 19
  • 33
0

this is because of the font you use in the UI. try to use fixed-width

Sooraj
  • 1