Jeff S
asked on
Formatting a field for a fixed length Flat File
I need to format a Flat File Fixed Length report for a client. In it they have allocated 12 characters for the patients phone number. In the file output, I need to format the phone exactly like this:
555/444-3333
I would like to know what would be the best way to right this value? I need to account for NULLs and if there is a NULL I need 12 blank spaces.
My field name is pp.Phone1
555/444-3333
I would like to know what would be the best way to right this value? I need to account for NULLs and if there is a NULL I need 12 blank spaces.
My field name is pp.Phone1
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Shoot, that won't work now that I think about it as it's always going to be adding "/" and "+" to the inside query, which makes it never null. If it is null, this will still return "/+" i believe. Sorry about that. Let me see what I can figure.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think radceasar has it. You're going to have to script something. Can you use T-SQL?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I want the two individuals get the points as they deserve and helped me. My solution was the one that worked, however they assisted to get me to that point. Please make sure they are awarded the points please.
ASKER
Thanks for the help and getting me to my final answer.
If it is different, like (###)###-###, then this will need a little modification. The key is that is always the same format, otherwise this won't work.