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

Posted on 2011-05-09
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

    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 100

    Assisted Solution

    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"



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now