• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

REPLACE function syntax fails using CHR

I have inserted the REPLACE function as part of my select statement but I'm receiving an error:
'chr' is not a recognized built-in function name.

See the REPLACE in the attached code.

What am I doing wrong?

Thanks
select
	t1.InvoiceNumber
	, t1.OriginalNumber
	, t1.DocumentDate
	, t1.CustomerPO
	, t1.ShipMethod
	, t1.RequestedShipDate
	, t1.PaymentTerms
	, t1.MasterNumber
	, t1.ShiptoName
	, t1.CustomerNumber
	, t1.ShiptoContact
	, t1.ShiptoName1
	, REPLACE(t1.ShiptoAddress1, chr(13), ' ')
	, t1.ShiptoAddress2
	, t1.ShiptoAddress3
	, t1.ShiptoCity
	, t1.ShiptoState
	, t1.ShiptoZip
	, t1.ShiptoCountry
	, t1.CustomerName
	, t1.BilltoContact
	, t1.BilltoAddress1
	, t1.BilltoAddress2
	, t1.BilltoAddress3
	, t1.BilltoCity
	, t1.BilltoState
	, t1.BilltoZip
	, t1.BilltoCountry
	, t1.JobNumber
	, t1.CallerID
	, t1.QuantityOrdered
	, t1.TotalBackordered
	, t1.FullItemNumber
	, t1.ItemDescription
	, t1.QuantitytoInvoice
	, t1.UnitPrice
	, t1.ExtendedPrice
	, t1.Comment1A
	, t1.Comment2A
	, t1.Comment3A
	, t1.Comment4A
	, t1.Subtotal
	, t1.MiscAmount
	, t1.TaxAmount
	, t1.FreightAmount
	, t1.TradeDiscount
	, t1.DocumentAmount
	, t1.Deposit
	, t1.AccountAmount
	, t1.Comment1
	, t1.Comment2
	, t1.Comment3
	, t1.Comment4
	, t2.[Tracking Number]
	, t1.CreditRep
	, t1.CreditRepEmail
	, t1.CreditRepPhoneNumber
	, t1.DueDate
from tempBT1 t1 
    left outer join tempBT2 t2 on t1.id = t2.id
	order by t1.InvoiceNumber

Open in new window

0
jdr0606
Asked:
jdr0606
1 Solution
 
jdr0606Author Commented:
Never mind, I answered my own question
0
 
blaazeCommented:
i think u trying to add a delimiter into ur query, if it is yes then u cannot use replace command to add a delimiter in the address field while querying
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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