Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 748
  • Last Modified:

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

0
mvalencia
Asked:
mvalencia
  • 3
  • 2
1 Solution
 
reb73Commented:
Use -

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

0
 
reb73Commented:
Similarly, use the following REPLACE function for ckheefullname -

REPLACE(ckheefullname, '.', '')
0
 
mvalenciaAuthor Commented:

Worked great! Thanks very much,
0
 
reb73Commented:
If you are happy to go ahead with the suggested solution, do you mind assigning points and closing this question? Thanks!
0
 
mvalenciaAuthor Commented:
Thanks again for the very quick and very good help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now