Skip to main content

On an Opportunity Proposal, we want to show/output the Opportunity Name and Start and End dates of the opportunity as the title on the Proposal.

We’ve created a calculated field...named “OpportunityNameAndDates” and entered the Expression as:

  [OpportunityName] + Char(10) + '(' + [OpportunityStartDate] + ' - ' + [OpportunityEndDate] + ')'

But this prints/outputs as:

Opportunity Name
(11/01/2025 00:00:00 - 04/30/2026 00:00:00)

Would anyone know how we can drop the Time portion/display and get to:

Opportunity Name
(11/01/2025 - 04/30/2026)

I’ve looked at and tried some of the functions available within the Expression Editor but can’t find extensive help for the Expression Editor.

@keithw try updating your expression for the "OpportunityNameAndDates" calculated field to:[OpportunityName] + Char(10) + '(' + Text([OpportunityStartDate], "MM/dd/yyyy") + ' - ' + Text([OpportunityEndDate], "MM/dd/yyyy") + ')'

This should output the dates in MM/dd/yyyy format, dropping the time (00:00:00) part. If "Text" doesn't work, try "Format" as an alternative: Format([OpportunityStartDate], "MM/dd/yyyy")—some expression editors use that instead.

Let me know if this works! 


Thank you ​@acostajb!

You inspired me to start a (mini-hackathon”. :)

My final expression is attached.

Notes:
-- the GetDay, GetMonth, and GetYear functions allow you to output date components as text/strings
-- the “len” function can be used to add leading zeros to months and days with a single digit
-- double quotes won’t work in the Expression Editor
-- the “if” function in an expression is actually “Iif”

Please let me know if you have any other suggestions.

Thanks again.  Just having someone else willing, and competent enough, to offer help encouraged me to tackle the problem.  Have a great day!


That’s awesome ​@keithw

And thank you-glad I could help spark some momentum! 


Why wouldn’t you just use a label field & instead of binding it to a specific endpoint put [OpportunityName] ([OpportunityStartDate] - [OpportunityEndDate]) as the text in the label?


@Kbaird,  Thank you for the suggestion.

In the future, I’ll definitely look to using labels with field content in them.

I tried your suggestion but the output included the time data (HH:mm:ss AM) which I didn’t want and the line feed code ( “+ Char(10) + “ )  [ See the attached screenshot in the third post  ] wouldn’t work in a Label.

By creating a calculated field, I could format (extract?) the date in a preferred format and get a line feed.

Your suggestion will work for simple outputs it appears, so I absolutely appreciate the input!