Z
Zamdrist
It appears as though, in the transition from a query to the datagrid I
am losing the carriage returns in an address field which I would like
to maintain for the purposes of a Word merge.
Here's the stored procedure. I have to Cast the data from text to
varchar in order to replace the @@ characters at the beginning of the
address field. But even if I don't do that and not cast it, I still
lose the carriage returns. Ideas? Thanks.
CREATE Procedure sp_UTL_MGAttorneyGroupMerge
@sAttorney Varchar(50),
@sGroup Varchar(50)
As
Select ContactName=Case FullName When '' Then CompName Else FullName
End,
Replace(Replace(Cast(AddrLines As Varchar(500)),'@@',''),'
',Char(10)+Char(13)) As AddressLine
Inner Join ContactCategories ContactAtty On ContactAtty.Contacts =
Contacts.Contacts
Inner Join ContactCategories ContactGroup On ContactGroup.Contacts =
Contacts.Contacts
Where ContactAtty.Category = @sAttorney And ContactGroup.Category =
@sGroup
Order By Contacts.LastName
am losing the carriage returns in an address field which I would like
to maintain for the purposes of a Word merge.
Here's the stored procedure. I have to Cast the data from text to
varchar in order to replace the @@ characters at the beginning of the
address field. But even if I don't do that and not cast it, I still
lose the carriage returns. Ideas? Thanks.
CREATE Procedure sp_UTL_MGAttorneyGroupMerge
@sAttorney Varchar(50),
@sGroup Varchar(50)
As
Select ContactName=Case FullName When '' Then CompName Else FullName
End,
Replace(Replace(Cast(AddrLines As Varchar(500)),'@@',''),'
',Char(10)+Char(13)) As AddressLine
From Contacts
Inner Join ContactCategories ContactAtty On ContactAtty.Contacts =
Contacts.Contacts
Inner Join ContactCategories ContactGroup On ContactGroup.Contacts =
Contacts.Contacts
Where ContactAtty.Category = @sAttorney And ContactGroup.Category =
@sGroup
Order By Contacts.LastName