[RESOLVED] Comparing two dates. vb.net 2005
I have this formula in my Crystal Report Select Expert
Code:
{WorkOrder.WODate} >= dateTimeVar fromdate and
{WorkOrder.WODate} <= datetimevar todate
Fromdate and Todate comes from two DateTimePickers.
I don't get an error but there's no output to the report.
Anyone knows what need to be done to make it work?
Is there a way to debug Crystal Report?
Thanks,
Pierrewhy
Re: Comparing two dates. vb.net 2005
You are declaring local variables but not setting them to a value. If FromDate and ToDate are Parameters the formula should be
{WorkOrder.WODate} >= {?fromdate} and
{WorkOrder.WODate} <= (?todate}
Re: Comparing two dates. vb.net 2005
Thanks for your help,
I have them declare in a module this way.
Code:
Public FromDate As Date
Public ToDate As Date
You example gave me "This field name is not known".
Where should they be declared?
Thanks,
Pierre
Re: Comparing two dates. vb.net 2005
Typically the Report would contain parameters. Crystal appends the question mark to parameter field names, ie ?FromDate. You can then use the parameter fields anywhere in your report like formula or database fields, like the code I posted earlier.
Once you add parameters to a report, Crystal will prompt the user for their values unless you overide the default screen. In your case you would simply set the parameter values = to the datapicker values or your variables declared in the module.
I don't use Crystal with .Net so can't comment on the required code...
Re: Comparing two dates. vb.net 2005
This work fine....Thanks for your help.
Pierre