Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbe question adding text to a formula

Status
Not open for further replies.

mark12010

IS-IT--Management
Apr 28, 2010
32
US
I have a formula that tells me the number of days since a patient was last seen:
Local NumberVar Days;
Days := DateDiff ("d",{billing_tx_history.date_of_service},CurrentDate)
the output is just, lets say 134. What I want the out put to say is "patient laset seen 134 days ago"
 
Local NumberVar Days;
Days := DateDiff ("d",{billing_tx_history.date_of_service},CurrentDate);
"Patient last seen " + totext(Days,0,"") + " days ago"

-LB
 
How do I add an ifnull statement using a variable. For example within this code if there was no billing_tx_history.date_of_service i want to say "no appt data on file"

LOCAL NumberVar Days;
Days := DateDiff ("d",{billing_tx_history.date_of_service},CurrentDate);
"Patient last seen " + totext(Days,0,"") + " days ago"
 
change your formula to this:

Numbervar Days;
if (isnull({billing_tx_history.date_of_service}) or TRIM({billing_tx_history.date_of_service})="")
then Days := "no appt data on file"
else Days := DateDiff ("d",{billing_tx_history.date_of_service},CurrentDate);
"Patient last seen " + totext(Days,0,"") + " days ago";

 
Numbervar Days;if (isnull({billing_tx_history.date_of_service}) or TRIM({billing_tx_history.date_of_service})="") then Days := "no appt data on file" else Days := DateDiff ("d",{billing_tx_history.date_of_service},CurrentDate);"Patient last seen " + totext(Days,0,"") + " days ago";

I am getting an error at
or TRIM({view_episode_summary_current.last_date_of_service})
this is highlighted {view_episode_summary_current.last_date_of_service}
and says "a string is required here"
 
Numbervar Days;
if (
isnull({billing_tx_history.date_of_service}) or
TRIM({billing_tx_history.date_of_service})=""
) then
Days := 99999999 else
Days := DateDiff ("d",{billing_tx_history.date_of_service}, CurrentDate);
if Days = 99999999 then
"No appt data on file" else
"Patient last seen " + totext(Days,0,"") + " days ago";

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top