Hi all, I'm using Crytal 6 and Oracle 8 to write a Turnaround Time report for our Lab system. (I'm new to Crystal)
I got the elapsed time to stuff to work beautifully and in my testing I hardcoded the date range so I wouldn't have to keep answering the parameters. This is what I used (and takes a few minutes to run):
{TESTREQ.STATUSDATE} in DateTime(2004,05,01,00,00,00) to DateTime(2004,05,02,23,59,00) and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
Now, I want to have the date range parameter values to enter at run time and I can't make it work. The hard coded date range above works fairly quickly, but the examples below take forever (more than an hour with still no returned records). I assume the field I'm using is OK since it works fine when I've got the DateTime hardcoded.
Here are some of the things I have tried:
This one has the StartDate and EndDate parameters as strings
{TESTREQ.STATUSDATE} in DTSToDateTime (Left ({?StartDate},4 ) + "," + Mid ({?StartDate},5 ,2 ) + "," + Mid ({?StartDate},7,2 ) + ",00,00,00") to
DTSToDateTime (Left ({?EndDate},4 ) + "," + Mid ({?EndDate},5 ,2 ) + "," + Mid ({?EndDate},7,2 ) + ",00,00,00") and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
This one both parameters are Dates:
{TESTREQ.STATUSDATE} in DateTime (Year ({?StartDate}),Month ({?StartDate}) ,Day ({?StartDate}) ,00 ,00 ,00 ) to DateTime (Year ({?EndDate}),Month ({?EndDate}) ,Day ({?EndDate}) ,00 ,00 ,00 ) and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
This didn't work either, I used both Date and Time Parameters, where all 4 parameters were strings.
{TESTREQ.STATUSDATE} in DTSToDateTime ({?StartDate} + " " + {?StartTime} + ":00:00") to DTSToDateTime ({?EndDate} + " " + {?EndTime} + ":00:00") and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
I'm betting the answer is obvious, but I'm stumped. All of these seem to be working, and I get "No errors found" when I use the Check in the formula editor. Can anyone out there help me? This should have been the easy stuff.
Thanks for any insight....
ainkca
I got the elapsed time to stuff to work beautifully and in my testing I hardcoded the date range so I wouldn't have to keep answering the parameters. This is what I used (and takes a few minutes to run):
{TESTREQ.STATUSDATE} in DateTime(2004,05,01,00,00,00) to DateTime(2004,05,02,23,59,00) and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
Now, I want to have the date range parameter values to enter at run time and I can't make it work. The hard coded date range above works fairly quickly, but the examples below take forever (more than an hour with still no returned records). I assume the field I'm using is OK since it works fine when I've got the DateTime hardcoded.
Here are some of the things I have tried:
This one has the StartDate and EndDate parameters as strings
{TESTREQ.STATUSDATE} in DTSToDateTime (Left ({?StartDate},4 ) + "," + Mid ({?StartDate},5 ,2 ) + "," + Mid ({?StartDate},7,2 ) + ",00,00,00") to
DTSToDateTime (Left ({?EndDate},4 ) + "," + Mid ({?EndDate},5 ,2 ) + "," + Mid ({?EndDate},7,2 ) + ",00,00,00") and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
This one both parameters are Dates:
{TESTREQ.STATUSDATE} in DateTime (Year ({?StartDate}),Month ({?StartDate}) ,Day ({?StartDate}) ,00 ,00 ,00 ) to DateTime (Year ({?EndDate}),Month ({?EndDate}) ,Day ({?EndDate}) ,00 ,00 ,00 ) and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
This didn't work either, I used both Date and Time Parameters, where all 4 parameters were strings.
{TESTREQ.STATUSDATE} in DTSToDateTime ({?StartDate} + " " + {?StartTime} + ":00:00") to DTSToDateTime ({?EndDate} + " " + {?EndTime} + ":00:00") and
{TESTREQ.STATUS} = "D" and
{TEST.TESTCODE} in {?TestCode}
I'm betting the answer is obvious, but I'm stumped. All of these seem to be working, and I get "No errors found" when I use the Check in the formula editor. Can anyone out there help me? This should have been the easy stuff.
Thanks for any insight....
ainkca