Storing a time / date

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Storing a time / date

Post by tford »

In a Custom Presentation or Report, using this:
CURRENT_TIMESTAMP, MMM dd yyyy h:mm a

Results in: Mar 31 2009 9:58 PM


I need to be able to concatenate a timestamp with some additional text to get a result like: Report #G3000 as of Mar 31 2009 9:58 PM

This needs to be stored in an attribute & not just displayed on a Custom Presentation or Report

Anyone have any ideas?
Tom - V8.8 build 3137 - MySql / PostGres
bazar2009
Posts: 75
Joined: Thu Mar 26, 2009 8:20 pm

Post by bazar2009 »

Hi Tom,

I'm not sure about your application design but if the data is stored in 1 business object couln't you have a rule something like the following:

test.DateAndText='#'+test.ReportNumber+ ' as of ' + test.DateStamp


Where DateAndText is the stored attribute with the '#' + Report Number + ReportNumber ' as of ' and the timestamp.

Bazar
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Tom,

I've not tested it but would something like

Object.Attribute = 'Report '+AS_STRING(Report.number)+'as of '+AS_STRING(CURRENT_TIMESTAMP, MMM dd yyyy h:mm a)

do the job ? (Assumes Object.Attribute is a Plain Text attribute)

It works for the CURRENT_TIMESTAMP (I've used it before) but I haven't tried it with the 'MMM dd yyyy h:mm a' structure before.


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

Post by tford »

Great -- thanks very much Peter -- it works! I think I tried every possibility except this obvious one :D

Minor clarification for future readers -- quotes are needed around the time stamp format:

Object.Attribute = 'Report '+AS_STRING(Report.number)+'as of '+AS_STRING(CURRENT_TIMESTAMP, 'MMM dd yyyy h:mm a')
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply