Adding spaces to text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am wondering if this is possible. I have 2 columns in a table:
Table Name : TESTTAB
Column Name1 : Depth, stores number
Column Name 2 : Name, stores text

Sample Data
Depth Name
-------------------
1 Master
2 Chief
3 Super
2 Admin
4 Paralegal

Is there a way to display as follows:

Master
Chief
Super
Admin
Paralegal

That is, convert the depth into prefixed-spaces or tabs?

I dont mind running a SQL to update the base table as well. But even this
has to be at run time since this table is overwritten by another process
frequently.

TIA
 
rKp said:
I am wondering if this is possible. I have 2 columns in a table:
Table Name : TESTTAB
Column Name1 : Depth, stores number
Column Name 2 : Name, stores text

Sample Data
Depth Name
-------------------
1 Master
2 Chief
3 Super
2 Admin
4 Paralegal

Is there a way to display as follows:

Master
Chief
Super
Admin
Paralegal

That is, convert the depth into prefixed-spaces or tabs?

I dont mind running a SQL to update the base table as well. But even
this has to be at run time since this table is overwritten by another
process frequently.

If you don't need the data to be updatable when you display it this way,
you can use a query like this:

SELECT String([Depth] - 1, " ") & [Name] AS ShowName
FROM TESTTAB;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top