We help IT Professionals succeed at work.

Remove period or dot from sql results

mvalencia
mvalencia asked
on
Medium Priority
768 Views
Last Modified: 2012-06-22
I am building a flat file for upload to a vendor. This file should contain no decimal points or periods. My results currently contain a decimal point in the money and a period after the middle initial of the name. I am using cast on the ckhcunetpay field as this returns two decimal places instead of four. In both cases there is data before and after the dot.

How can I remove the dot.

Thanks,
select
'000000' as start,
ckhcheckno,
'011111111111111100000' as space1,
cast (ckhcurnetpay as char) as amount,
ckheefullname
from
chkhead
where
ckhcheckno > '4177'

Open in new window

Comment
Watch Question

Commented:
Use -

REPLACE(cast(chkcurnetpay as char), '.', '')

Commented:
Similarly, use the following REPLACE function for ckheefullname -

REPLACE(ckheefullname, '.', '')

Author

Commented:

Worked great! Thanks very much,
Commented:
If you are happy to go ahead with the suggested solution, do you mind assigning points and closing this question? Thanks!

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks again for the very quick and very good help.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.