Display Zero DATE values

Hi all
I am monitoring the timing of test emails. When I send the message, I create a record with
msg:SendDate = Today()
msg:ReceiveDate = 0

If the message isn’t delivered, the Receive Date column (using “@D08-” ) shows unwanted characters because the value is zero. The Clarion docs warn against this, but don’t suggest an alternative.

How do I get the browse form to display “-” or something a little less buggy? How do I do some conditional formatting?
All suggestions welcome. Thanks in advance.

Clarion PE 11.0.13630

How about “@D08-B” ?


instead of real field - use temp string variable,
then in SetQueueRecord
set it and FORMAT() like

if youVar = 0
    stringVar = ''
    stringVar = FORMAT(youVar,@D08-)

One advantage of the String is you can use words like ‘Today’, ‘Yessterday’, ‘4 Days Ago’ that make it easy to spot recent data without having to read the Date and think of Today’s date

IF Msg:ReceiveDate = 0
    RcvString = ''
    DaysAgo = TODAY() - Msg:ReceiveDate
    CASE DaysAgo
    OF 0 ; RcvString='Today'
    OF 1 ; RcvString='Yesterday'
    OF 2 TO 9 ; RcvString=DaysAgo &' Days Ago'
         RcvString = FORMAT(msg:ReceiveDate,@D08-)

An alternative would be if its 2 to 6 days ago you show the Day of Week. So if today is Tuesday instead of showing ‘4 Days Ago’ show ‘Friday’. Seems easier to understand ‘4 Days Ago’.

1 Like

Receive time column also should be formatted with “B” modifier to eliminate 00:00:00 values. As well as Delay column.

Thanks everyone for the suggestions. For now, I am using the @D08-B date picture, and a similar one for the “receive time” and “delay” pictures. But I will keep the other suggestions in my bag of tricks for future projects or improvements.

1 Like

A plain string is useful for variable types, such as if you have a Percent, Currency, or Qty, etc.

1 Like