PDA

View Full Version : how do I use display format on null value cells?


ABC123

Steve Wood
09-28-2004, 12:29 PM
I have a column of dates. Occassionally they are blank yielding "//" in my grid display (I'd prefer them to be blank). How do I format to accomplish the following:

if a valid date: time("W:MM-dd-yy","value")).
if blank, the phrase: "N/A"

If I just use a display format of time("W:MM-dd-yy"), every blank date value produces an erroneous displayed value like this: ""BA:00-00-00".

Edward Larrabee
09-29-2004, 06:58 AM
It sounds like you are trying to place a character value into a date field. Perhaps you want to place date strings into a character field. Then, code in the Validate event for the field will allow you to change the display.

Edward Larrabee
09-29-2004, 07:27 AM
A correction. The validate event is not yet available for grids.

Steve Wood
09-29-2004, 02:22 PM
I resolved this with a calculated field as follows:

vShip_date = if(len(alltrim(cdate(Shipped_Date)))=8,time("W:MM-dd-yy",Shipped_date),"")