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

DateTime field to just Date 2

Status
Not open for further replies.

gbobbie

Technical User
Aug 9, 2006
52
US
CR 9

I am using the following formula to show dates that are selected via a parameter:

"Address Info Changes: " & minimum({?Dates - Address}) & " - " & maximum({?Dates - Address})

I put the formula in my report and it works fine, however the dates come up as datetime and I only want them to show date. I went to File, Options in Crystal and changed the Date and Time field options to just date, which works fine when viewing in Crystal, but when I view in the report viewer in our database, they come across as datetime. Is there a formula that will convert the above results to date only?

Thanks!
 
Try ToText({?Dates - Address}, "dd/MM/yy").

You can also set default displays using File > Options > Fields, changing the default. Where I work, we never record time but the database makes every date a date-time field, which I've set it to suppress.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you. Where would I put this formula? In the formula field itself?
 
Address Info Changes: " + totext(minimum({?Dates - Address}),"MM/dd/yyyy") + " - " + totext(maximum({?Dates - Address}),"MM/dd/yyyy")

Change the date format to whatever you like.

-LB
 
minimum(Date({?Dates - Address})) will also change the field typpe to Date instead of DateTime.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top