Link to home
Start Free TrialLog in
Avatar of mvalencia
mvalencia

asked on

Remove period or dot from sql results

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

Avatar of reb73
reb73
Flag of Ireland image

Use -

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

Similarly, use the following REPLACE function for ckheefullname -

REPLACE(ckheefullname, '.', '')
Avatar of mvalencia
mvalencia

ASKER


Worked great! Thanks very much,
ASKER CERTIFIED SOLUTION
Avatar of reb73
reb73
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again for the very quick and very good help.