|
-
Oct 16th, 2007, 04:01 PM
#1
Thread Starter
Member
[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
-
Oct 16th, 2007, 04:39 PM
#2
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}
-
Oct 16th, 2007, 04:49 PM
#3
Thread Starter
Member
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
-
Oct 16th, 2007, 05:44 PM
#4
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...
-
Oct 16th, 2007, 05:58 PM
#5
Thread Starter
Member
Re: Comparing two dates. vb.net 2005
This work fine....Thanks for your help.
Pierre
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|