?
Solved

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

Posted on 2011-05-09
2
Medium Priority
?
334 Views
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.

Thanks
0
Comment
Question by:nicbak13
2 Comments
 
LVL 77

Accepted Solution

by:
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."
else
"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.
0
 
LVL 101

Assisted Solution

by:mlmcc
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."
else
"Some other text"

mlmcc

0

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