If I have a table with 2 fields:
[pre]
VARCHAR2 NUMBER
MY_NAME MY_NUMBER
ABCD 15
[/pre]
And user wants to see as an outcome:[tt]
MyField
ABCD-015[/tt]
I should do:[tt]
Select MY_NAME || '-' || TO_CHAR(MY_NUMBER, '000') As MyField
[/tt]
But this way I get:[pre]
ABCD- 015[/pre]
With the space between the – and 015
To eliminate the space, I know I can do this:[tt]
Select MY_NAME || '-' || [blue]TRIM([/blue]TO_CHAR(MY_NUMBER, '000')[blue])[/blue] As MyField
[/tt]
But I should not need to do it, right?
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
[pre]
VARCHAR2 NUMBER
MY_NAME MY_NUMBER
ABCD 15
[/pre]
And user wants to see as an outcome:[tt]
MyField
ABCD-015[/tt]
I should do:[tt]
Select MY_NAME || '-' || TO_CHAR(MY_NUMBER, '000') As MyField
[/tt]
But this way I get:[pre]
ABCD- 015[/pre]
With the space between the – and 015
To eliminate the space, I know I can do this:[tt]
Select MY_NAME || '-' || [blue]TRIM([/blue]TO_CHAR(MY_NUMBER, '000')[blue])[/blue] As MyField
[/tt]
But I should not need to do it, right?
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.