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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting fields in a formula

Status
Not open for further replies.

mark12010

IS-IT--Management
Apr 28, 2010
32
US
I have a formula that ouputs "NO APPT DATA ON FILE FOR " + fIELD + "PATID" + FIELD + FIELD + "FOR EPISODE" + FIELD IF THE SERVICE DATE ISNULL.
A sample of the output is;
NO APPT DATA ON FILE FOR DOE,JOHN PATID: 2,306.00 FOR EPISODE 1.00
I need to format the GroupName ({avatar_jail.Pat Name}) to be bold the TOTEXT ({avatar_jail.PATID}) needs to output 2306 NOT 2,306.00 also TOTEXT ({avatar_jail.Episode#}) needs to output 1 NOT 1.00
Here is my formula
IF ISNULL ({meditech_accts.SERVICE DATE})
THEN "NO APPT DATA ON FILE FOR " + GroupName ({avatar_jail.Pat Name})+" "+"PATID: "+TOTEXT ({avatar_jail.PATID})+" "+"FOR EPISODE "+ TOTEXT ({avatar_jail.Episode#})
 
Change this

"NO APPT DATA ON FILE FOR " + GroupName ({avatar_jail.Pat Name})+" "+"PATID: "+TOTEXT ({avatar_jail.PATID})+" "+"FOR EPISODE "+ TOTEXT ({avatar_jail.Episode#})

to

"NO APPT DATA ON FILE FOR " + GroupName ({avatar_jail.Pat Name})+" "+"PATID: "+TOTEXT ({avatar_jail.PATID}, 0, "")+" "+"FOR EPISODE "+ TOTEXT ({avatar_jail.Episode#}, 0, "")

Ian
 
Ian:
Thanks for the quick reply it works just like I want but is there a way to make the GroupName ({avatar_jail.Pat Name}) bold?
 
Not within the formula, you can change out to be html and then format last bit to be bold, but my Html is not very good.

Alterntively you can drop

+ TOTEXT ({avatar_jail.Episode#}, 0, "")

from formula, place formula and field in a text box, then format field to be bold etc and suppress when
NOT (ISNULL ({meditech_accts.SERVICE DATE}))

Ian
 
OK I can deal without the bold name but I have added to the formula:
Numbervar Days;
if (isnull({meditech_accts.SERVICE DATE}))
then Days := 99999999 else
Days := DateDiff ("d",{meditech_accts.SERVICE DATE}, CurrentDate);if Days = 99999999
then GroupName ({avatar_jail.Pat Name})+" "+" NO APPT DATA ON FILE FOR " +"PATID: "+TOTEXT ({avatar_jail.PATID}, 0, "")+" "+"FOR EPISODE "+ TOTEXT ({avatar_jail.Episode#}, 0, "")
ELSE
{meditech_accts.PATIENT}+" "+ "LAST SEEN ON "+TOTEXT ({meditech_accts.SERVICE DATE});

When the else kicks in my output is:
DOE,JOHN LAST SEEN ON 1/27/2010 12:00:00AM
Is ther a way to parce out the time and just display 1/27/2010
 
use

{meditech_accts.PATIENT}+" "+ "LAST SEEN ON "+TOTEXT ({meditech_accts.SERVICE DATE}, 'MM/d/yyyy);

or

{meditech_accts.PATIENT}+" "+ "LAST SEEN ON "+TOTEXT ({meditech_accts.SERVICE DATE}, 'MM/dd/yyyy);

if you want leading zero on days

If you go to help - Search and type totext it will guide you on all formatting options.

Ian
 
To get the bold, use the following and then go to format field->paragraph->text interpretation and choose "HTML Text":

Numbervar Days;
if isnull({meditech_accts.SERVICE DATE}) then
Days := 99999999 else
Days := DateDiff ("d",{meditech_accts.SERVICE DATE}, CurrentDate);
if Days = 99999999 then
"<b>"+{avatar_jail.Pat Name}+"</b>" +" "+
" NO APPT DATA ON FILE FOR " +"PATID: "+
TOTEXT ({avatar_jail.PATID}, 0, "")+
" "+"FOR EPISODE "+
TOTEXT ({avatar_jail.Episode#}, 0, "") ELSE
{meditech_accts.PATIENT}+" "+ "LAST SEEN ON "+
TOTEXT ({meditech_accts.SERVICE DATE},"M/dd/yyyy");

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top