8.1 Calculated Column testing

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2457
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

8.1 Calculated Column testing

Post by Jaymer »

I can't say I've had 100% success with the new CC.
Most times I give up and do something a different way.
This time I wanted this output:
Screen Shot 2018-05-31 at 12.31.46 AM.png
Screen Shot 2018-05-31 at 12.31.46 AM.png (9 KiB) Viewed 4875 times
but when my calculated was this: AS_STRING(Lead.DateLastActivity) + ' (' + Lead.LastActivityType + ')'

i got this:
Screen Shot 2018-05-31 at 12.26.56 AM.png
Screen Shot 2018-05-31 at 12.26.56 AM.png (10.52 KiB) Viewed 4875 times
Tried a format string but it didn't like that:
Screen Shot 2018-05-31 at 12.26.05 AM.png
Screen Shot 2018-05-31 at 12.26.05 AM.png (9.76 KiB) Viewed 4875 times
Once I saw what I had (showing the 12:00AM time), then it occurred to me:
CHARS_FROM_LEFT(AS_STRING(Lead.DateLastActivity),11) + ' (' + Lead.LastActivityType + ')'

Thats a lot nicer than having two columns. Hopefully this will continue to mature in future versions.

I give it the Clap !
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: 8.1 Calculated Column testing

Post by tford »

I think it would have worked if you used 'MM/dd/yy' instead of 'mm/dd/yy' (with M parameter in caps)
Tom - V8.8 build 3137 - MySql / PostGres
Jaymer
Posts: 2457
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: 8.1 Calculated Column testing

Post by Jaymer »

I did that first, then fell back to the lowercase M as a second test.

The docs do not show that AS=STRING allows a format parameter.
Also, if you look at the format masks for a date or timestamp field, they both upper and lower case M’s. The lowercase M‘s suppress the leading zero for months one through nine (I believe)
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: 8.1 Calculated Column testing

Post by BLOMASKY »

I didn't try it, but can you replace the comma with the @ sign AS_STRING(BO.attr@'mm/dd/yy')

bruce
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: 8.1 Calculated Column testing

Post by tford »

The docs do not show that AS=STRING allows a format parameter.
Also, if you look at the format masks for a date or timestamp field, they both upper and lower case M’s. The lowercase M‘s suppress the leading zero for months one through nine (I believe)
This is a tangent, but I keep this little cheat sheet to get date formatting the way I want it:

<<Current_Date, MMM d, yyyy>> - Jan 25, 2012
<<Current_Date, M/d/yyyy>> - 1/25/2012
<<Current_Date, MMMM d, yyyy>> - January 25, 2012
<<Current_Date, MMM d, yyyy>> - Jan 25, 2012
<<Current_Date, MMM d, yyyy>> - Jan 25, 2012
<<Current_Date, EEEE, MMM d, yyyy>> Wednesday, Jan 25, 2012
<<Current_Date, EEE, MMM d, yyyy>> - Wed, Jan 25, 2012
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply