Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: Find number of records between a particular period

    I am using Crystal Reports Advanced Developer Edition10 with JSP.
    I have a JSP page where user selects a particular month and year (say January 2004) and then she selects another month and year (say March 2005). (That means there are 4 list boxes, one for each month and year)
    I need to display records between that particular period(that is between January 2004 and March 2005 in the example above) from a database table. In the table there are 2 columns month and year which store values such as

    January 2004
    February 2004
    June 2004
    august 2004
    March 2005

    But when i use the select expert it makes the formual such as

    {SALES.MONTH} >= {?month} and
    {SALES.MONTH} <= {?month1} and
    {SALES.YEAR} in {?year} to {?year1}

    which does not give desired results.

    The values in the database and in the list boxes are in the form of strings but i need to compare them as months and years.
    please help.

  2. #2
    Join Date
    Oct 2003
    BA, Argentina

    Post A bit more complicated

    Your condition will not work, its a bit more complicated:

    ({SALES.YEAR} > {?year} OR ({SALES.YEAR} = {?year} AND {SALES.MONTH}>= {?month})) AND ({SALES.YEAR} < {?year1} OR ({SALES.YEAR} = {?year1} AND {SALES.MONTH}<= {?month1}))
    Last edited by jigarzon; 05-28-04 at 09:46. Reason: title was wrong

Posting Permissions

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