Showing posts with label selection. Show all posts
Showing posts with label selection. Show all posts

Tuesday, March 27, 2012

Date problem in Selection formula

Hi,
I am using Crystal Reports 9 and i am facing some problem in creating a selection formula to select some records in between a range of given dates.

MY DATE PARAMETER IS A STRING AND I NEED TO CONVERT IT TO DATE TYPE

Actually I don't know how to make to needed selection formula. What i really needed is to select record sets in between a range of dates which is given as parameters to the reports

Pls help
JOBINuse record selection formula

urfield >=dateparameter1 and urfield<=dateparameter2

Thursday, March 22, 2012

Date parameter format

Hi All
I am using this formula
ToText({HECO_SP_GMWOUT_GROSS.DD},"MM/dd/yy") in ({?StartDate} to {?EndDate})
in Record selection formula for startdate and enddate parametrs, i need date format like this "MM/DD/YY".
And it throws me error like " "Bad Number format string"
Any solution please.
Thank youtry something like this:
CStr({HECO_SP_GMWOUT_GROSS.DD}, "yyyy MMM dd, dddd");

in ur case i guess it would be
CStr({HECO_SP_GMWOUT_GROSS.DD}, "MM/dd/yy");|||Hi Niro,
Thank you for ur reply but it still showing same error.
is there any other way.
Thankyou.|||which format are you sending parameter values?
You can also try using procedure that does the filtering and design the report based on that procedure|||I guess your start and end date parameters are strings (which happen to be dates in MM/dd/yy format) and your database column is a date?
Try converting your parameters into dates rather than your date into a string.

{HECO_SP_GMWOUT_GROSS.DD} in CDate({?StartDate}) to CDate({?EndDate})

You may need to use CDateTime instead of CDate, depending on the DD datatype.

You should also test the parameters using IsDate first.