AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Concat function - h...
 
Notifications
Clear all

Questions Concat function - how to add an apostrophe to a string?

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Rob Cushen 5 years ago
8 Posts
3 Users
3 Reactions
6,640 Views
RSS
Rob Cushen
Posts: 24
 Rob Cushen
Topic starter
September 13, 2020 7:51 am
(@robcushen)
Eminent Member
Joined: 6 years ago

Hi,

How would you concatenate an apostrophe in front of a string? 

Assume I wanted to produce the string 'Hi

= Concat('Hi','Hi')  yields the string HiHi

= Concat(''','Hi')  yields missing operator before the Hi operand message

 


7 Replies
Wyatt.ERP
Posts: 128
 Wyatt.ERP
September 14, 2020 8:25 am
(@wyatt-erp)
Estimable Member
Joined: 6 years ago

Hi @robcushen,

The formulas use SQL syntax, so ' is used as the start and end character of a string.  To make ' be a part of the string, you have to escape it with a second '.  In short, you'd need this:

=Concat('''','Hi')

Reply
Rob Cushen
Posts: 24
 Rob Cushen
Topic starter
September 15, 2020 12:34 pm
(@robcushen)
Eminent Member
Joined: 6 years ago

Hi wyatt-erp,

Thanks for responding.

That is one of the first things I tried, but I got a different result when I View the Inquiry.

I get ''Hi as a result (2 leading apostrophes). 


Reply
Wyatt.ERP
 Wyatt.ERP
(@wyatt-erp)
Joined: 6 years ago

Estimable Member
Posts: 128
September 16, 2020 9:45 am
Reply toRob CushenRob Cushen

@robcushen

 

Hmm, that is strange, what version are you on?  On my test 2020R1 instance, it is giving just a single quote in results.

image

Reply
Rob Cushen
Posts: 24
 Rob Cushen
Topic starter
September 16, 2020 3:53 pm
(@robcushen)
Eminent Member
Joined: 6 years ago

Using Acumatica 2018 R2 with customizations.   

Maybe that has something to do with it.

Thanks again.


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
October 21, 2020 9:04 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Maybe you are using a different version of SQL Server or MySQL?


Reply
Wyatt.ERP
Posts: 128
 Wyatt.ERP
October 26, 2020 10:42 am
(@wyatt-erp)
Estimable Member
Joined: 6 years ago

Hey @robcushen, I had an idea on this over the weekend if the GI is still giving you problems with this. 

I feel like you can use an Attribute to solve this.  I made instructions on how to set up Attributes here: https://www.augforums.com/forums/postid/5761/

So, you can make an attribute and name it "CONSTANTS".  The control type will be Combo.  The value will be your key to looking up the constant, and the Description will be what you actually want to appear.  In this case, I used "APOSTROPHE" as the Value ID and put in ' as the Description.

image

Next, add CSAttributeDetail to your GI.  Add a relation to CSAttributeDetail to any table on CSAttributeDetail.AttributeID ='CONSTANTS' and CSAttributeDetail.ValueID = 'APOSTROPHE'.  You should be able to use = Concat([CSAttributeDetail.Description],'Hi') to get a single apostrophe where you need. 


Reply
Rob Cushen reacted
Rob Cushen
Posts: 24
 Rob Cushen
Topic starter
October 27, 2020 8:32 am
(@robcushen)
Eminent Member
Joined: 6 years ago

Hi Wyatt.ERP,

In most engagements, I have full SQL server access & functionality.  In that environment almost anything is possible!

I ended up going another route to get to a quick solution in this case.    Thank you very much for providing this creative solution.   It may well come in handy the next time I encounter a similar issue.

Thanks again!


Reply
Tim Rodman and Wyatt.ERP reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 32 Online
  • 2,412 Members
Our newest member: thollings
Latest Post: Attribute Input Mask
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×