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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove seconds from a date/time value

Status
Not open for further replies.

ejerblom

Technical User
Sep 22, 2003
10
SE
Hi,

I wonder how you can remove the seconds from a date/time value. The date is displayed like this:

2004-01-25 11:45:45

but I want no seconds, I want it do be displayed like this:

2004-01-25 11:45

Because I want to compare the dates with no seconds. How can this be done?

Regards
Ulrika
 
In Crystal 8.5, you can either cusomise the field itself, or use a formula field which does so.

To customise, right-click on the field, select [Format Field] and then [Customise]. Also [Options] under [Files] on the menu would let you change the defaults for each new report or each newly placed field. But the drawback of doing it this way is that things may go wrong when the same report is run on another machine with different Options set.

Using Formual Fields is always safe and is more flexible. I'd do it like this
If isnull {your.datetime} then "No Date/Time"
else Totext({your.datetime}, "yyyy-MM-dd HH:mm")

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top