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

Date Query in Crystal 8.5 not selecting records with BegDate

Status
Not open for further replies.

KristiW

Programmer
May 12, 2010
1
US
I have report in Crystal 8.5 that prompts for DateRange, and then selected records based on the beg and end dates in the range. However, no records matching the beginning date are being selected. If I copy the SQL query out of Crystal and paste it into query analyzer, the all records are selected.

The formula I used in the Select Expert to select the records is:
{DATA_FILE.INVDTE} >= Minimum({?p_DateRange}) and
{DATA_FILE.INVDTE} <= Maximum({?p_DateRange})

where p_DateRange is a parameter field with value type of Date.

After previewing the report, if I view the SQL Query, the where clause of the query is the following:

WHERE
DATA_FILE."INVDTE" >= {d '2010-04-01'} AND
DATA_FILE."INVDTE" <= {ts '2010-04-30 23:59:59.000'}


Anybody else run across this problem?

Thanks!
 
I just tried to recreate the issue in CR 8.5 using the Xtreme database, but it worked as expected, and the show SQL query displayed:

SELECT
Orders.`Order Date`
FROM
`Orders` Orders
WHERE
Orders.`Order Date` >= {ts '2000-01-01 00:00:00.00'} AND
Orders.`Order Date` < {ts '2005-01-01 00:00:00.00'}

Record selection formula:

{Orders.Order Date} >= minimum({?Date Range}) and
{Orders.Order Date} <= maximum({?Date Range})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top