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!

Losing Date Format in Infoview

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR2008 with an Oracle db as a data source. I have a number of date fields to display, and the format to be used is 01-Jan-2011. Because some dates were missing in migrated data, bogus dates were used to populate some records (ex 01-Jan-1111). The requirement is for any bogus date to be replaced with a text phrase (ex. if it's a dispatch date, the text should read "Dispatched" rather than showing the 01-JAn-1111). I changed the field format to text in order to use an if-then formula to replace the bogus dates with text (If @Dispatch Date = 01-Jan-1111 then "Dispatched" else @Dispatch Date). The formula works and the date format is correct when viewing in Crystal. When I export to Infoview, the dates are appearing dd/mm/yyyy rather than dd-Mon-yyyy. I assume I'm losing the formatting because I've changesd the date field to text. How do I retain my date formatting in Infoview??
 



hi,

What you need in this generated field, is ALL TEXT and not a mixture of Text & Dates.
[tt]
If @Dispatch Date = 01-Jan-1111 then "Dispatched" else Format(@Dispatch Date,"dd-mmm-yyyy")
[/tt]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Try:

if {@Dispatch Date} = date(1111,1,1) then
"Dispatched" else
totext({@Dispatch Date},"dd-MMM-yyyy")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top