Results 1 to 3 of 3

Thread: [RESOLVED] CR 11 Passing a Dates as Parameters

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] CR 11 Passing a Dates as Parameters

    Hello,
    I am having trouble passing 2 dates as parametes for my report which are used in the selection of records.

    I am passing them same as I would for a string but they are dates:

    VB Code:
    1. crxReport.ParameterFields.GetItemByName("startdate").AddCurrentValue Format$(dStartDateRCE, "yyyy/mm/dd")
    2.         crxReport.ParameterFields.GetItemByName("enddate").AddCurrentValue Format$(dEndDateRCE, "yyyy/mm/dd")

    Everytime I run the report it prompts me for date values...

    this is the selection code that is using the parameters:

    VB Code:
    1. {Agent.Agent_Date_Of_Contract} >= {?startdate} and
    2. {Agent.Agent_Date_Of_Contract} <= {?enddate}

    anyone know what I am doing wrong?

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: CR 11 Passing a Dates as Parameters

    removed an on error statment in the sub passing the parameters and I get a type mismatch error now... anyone know what's up?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: CR 11 Passing a Dates as Parameters

    Ok as far as I can see Crystal will not take a date as a date type parameter.

    I had to set the paramters in the report to be strings. Then I had to make formula fields for each of the date parameters that typecasts them to dates. Then enter the formula fields in my selection formula instead of the parameter field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width