What is a good formula for dates in using to search a report. The one I presently use requires the mm/dd/yyyy. Is there one available that would allow mm/dd/yy. What are some of the ones you experts use, the more selections the better. TIA
Ken
I use the date as a parameter field to search a report for records between 2 dates. I just wanted to know how to input the dates so crystal could use them. Presently I use
if {?Start Date} = "" then PrintDate
Else
If NumericText(Left({?Start Date},2)) = True
Then if NumericText(Right(Left({?Start Date},5),2)) = True
Then Date(ToNumber(Right ({?Start Date},4)),ToNumber(Left({?Start Date},2)),ToNumber(Right(Left({?Start Date},5),2)))
Else Date(ToNumber(Right ({?Start Date},4)),ToNumber(Left({?Start Date},2)),ToNumber(Right(Left({?Start Date},4),1)))
Else if NumericText(Right(Left({?Start Date},5),2)) = True
Then Date(ToNumber(Right ({?Start Date},4)),ToNumber(Left({?Start Date},1)),ToNumber(Right(Left({?Start Date},4),2)))
Else Date(ToNumber(Right ({?Start Date},4)),ToNumber(Left({?Start Date},1)),ToNumber(Right(Left({?Start Date},3),1)))
And I was just wondering if there were any other formulas out there that were different, shorter, and any that excepted 01 instead of 2001 for a year.Sorry I was so unclear on the question.
You have a CHARACTER parameter used for selecting records and a DATE field that it is used against. You want to enter the parameter text value in mm/dd/yy format and need a formula to convert this into a date value so that you can use it in your selection formula.
I have a formula in my "common formulas" area (See the FAQ on common formulas) that will convert a character date into a true date with either 2 or 4 character year. See if this will help.
The problem with a 2 digit year is that you have to assume which century it is in. My formula assumes that anything less than 50 is 2000 and over 50 is 1900. If you enter all 4 digits it just uses what you enter. Ken Hamady
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.