Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format display of date within a formula

Status
Not open for further replies.

markajem

Programmer
Dec 20, 2001
564
US
Brain is not functioning today very well.

Here is my formula:

[tt]
if {POP10110.PRMDATE} = CDateTime (1900, 01, 01, 00, 00, 00)
then "___/___/___"
else {POP10110.PRMDATE}
[/tt]

in the else clause I would like {POP10110.PRMDATE} to be formated as: 3 letter month, 2 digit day and 2 digit year (mmm-dd-yy). Cant see to figure out which format to use. This is a datetime field.

Thanks


Mark
Email: markanas333@hotmail.com
 
Try:
Code:
if {POP10110.PRMDATE} = CDateTime (1900, 01, 01, 00, 00, 00)
then "___/___/___"
else ToText({POP10110.PRMDATE},"MMM-dd-yy")

~Brian
 
A very minor point but I think the ELSE should have the same format as the other

if {POP10110.PRMDATE} = CDateTime (1900, 01, 01, 00, 00, 00)
then "___/___/___"
else ToText({POP10110.PRMDATE},"MMM/dd/yy")


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Thanks so much Brian and Jim. Worked great and figured it was easy; just thinking to hard.

Thanks

Mark

Mark
Email: markanas333@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top