How do I insert a field in the middle of a text string in a formula

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
No doubt a simple question, but I can't work out the syntax.

I have a formula that asks if a field has data, then print a text line with another data field within the text. Exact example is:

if {CAC_database_field1} <> 0.00  then
'A part payment of {CAC_Database_field2} has been allocated'

I have tried splitting the text, inserting () around the datafield but can't seem to pick the right syntax.

Can someone put me on the straight and narrow.

Question by:nicbak13
LVL 77

Accepted Solution

peter57r earned 1000 total points
ID: 35718963
if {CAC_database_field1} <> 0.00  then
"A part payment of " & totext({CAC_Database_field2}, 2,"")  & " has been allocated."
"Some other text"

If this is not the right format for the amount then you will have to post back with details of what is required.
LVL 101

Assisted Solution

mlmcc earned 1000 total points
ID: 35719848
When you say you are testing if the field has data you might also need to  test for NULL

if Not IsNull({CAC_database_field1}) AND {CAC_database_field1} <> 0.00  then
"A part payment of " & totext({CAC_Database_field2}, 2,"")  & " has been allocated."
"Some other text"



Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question