Results 1 to 13 of 13
  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: crystal report date time parameter

    Hi, having issue with date time parameter in report. Using Crystal 8, with a seperate start and end date time parameter. No default values, so when parameter selected, the current date/time is displayed. This is fine but when the start parameter is changed, it changes the end parameter to same. I don't understand why this is happening, but requires the user to manually select the end parameter. In this application the current date time is usually fine, so makes an unecessary step. Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Posts
    6

    crystal date time parameter

    Ok, used a range value, and that works pretty good, but new problem, how do you get the two range values (start date, end date), in the actual report (to show user the date range queried on)? If you drop the parameter field in report, no data displays. Know there is an issue with this type of field when multiple (string) values are used, crystal only looks at first item in an array. But this problem appears different. Any help appreciated....thanks

  3. #3
    Join Date
    Feb 2004
    Posts
    3

    Re: crystal date time parameter

    Originally posted by lardan30
    Ok, used a range value, and that works pretty good, but new problem, how do you get the two range values (start date, end date), in the actual report (to show user the date range queried on)? If you drop the parameter field in report, no data displays. Know there is an issue with this type of field when multiple (string) values are used, crystal only looks at first item in an array. But this problem appears different. Any help appreciated....thanks
    Use this formula on your report:

    //{@DateRange}

    WhilePrintingRecords;
    DateVar date1;
    DateVar date2;
    date1:=Minimum (Date Field Here);
    date2:=Maximum (Date Field Here);
    "Report For Period: " + totext(date1) + " To " + totext(date2)

  4. #4
    Join Date
    Feb 2004
    Posts
    6
    thanks, give it a shot....

  5. #5
    Join Date
    Feb 2004
    Posts
    6
    Does work, but has to be datetime var as opposed to date var....however I still have an issue in that I really need the range dates displayed. Your solution, which I thank you for regardless, only address the minimum and maximum datetime entries in database, not the actual selection datetime range, which is usually different...know there has to be a way, Ill keep playin!!

  6. #6
    Join Date
    Feb 2004
    Posts
    3
    The datetime variable issue is easily solved by simply modifying the formula:

    //{@DateRange}

    WhilePrintingRecords;
    DateTimeVar date1;
    DateTimeVar date2;
    date1:=Minimum ({Delivery.Delivery Date});
    date2:=Maximum ({Delivery.Delivery Date});
    "Report For Period: " + totext(date1) + " To " + totext(date2)

    The second problem you bring up confuses me. This formula is actually the accepted solution that is offered in the Business Objects KB (ref: Article ID: c2000534) for Crystal Reports 6.x +.

    If you're using a parameter in your report, this formula is designed to display the min / max date range pulled from that recordset based on the date parameter. It does not pull the min / max date range for the entire database.

    Perhaps I'm missing something, if you elaborate more on the problem, maybe I can help.


    Originally posted by lardan30
    Does work, but has to be datetime var as opposed to date var....however I still have an issue in that I really need the range dates displayed. Your solution, which I thank you for regardless, only address the minimum and maximum datetime entries in database, not the actual selection datetime range, which is usually different...know there has to be a way, Ill keep playin!!

  7. #7
    Join Date
    Feb 2004
    Posts
    6
    I did use datetime value as opposed to the date value, and it did display the first record and last record based on the query as it should have. What I am looking to display is the range values inputted into the date time range value parameter by the user. In other words displaying what date range the report is supposed to encompass.

    For example, the range values inputted are beginning date of 2/1/04 00:00:00 and end date of 2/8/04 00:00:00.

    However within the data base the first record found is 2/2/04 23:00.00 and last record found is 2/7/04 15:59.00. Therefore the current formula would display those two dates/times....the minimum and maximum date times found based on the query.... that make sense? thanks for all the help, and looking at the issue.

  8. #8
    Join Date
    Feb 2004
    Posts
    3
    OHH!

    That's easy!

    Modify the existing formula to this:

    //{@DateRange}

    WhilePrintingRecords;
    DateTimeVar date1;
    DateTimeVar date2;
    date1:=Minimum ({?DATE RANGE});
    date2:=Maximum ({?DATE RANGE});
    "Report For Period: " + totext(date1) + " To " + totext(date2)



    {?DATE RANGE} would be the name of your date range parameter. Hope this helps.

  9. #9
    Join Date
    Feb 2004
    Posts
    6
    THANK YOU!....I should have got that, I was close....but again thanks for the help. Works like a charm!

  10. #10
    Join Date
    Nov 2008
    Posts
    8

    crystal reports date parameter help

    try this link : crystal reports date parameter help in vb.net

    http://vb.net-informations.com/cryst...meter_date.htm

    yang.

  11. #11
    Join Date
    Jul 2010
    Posts
    4

    Date stored as String

    I am using MS Access as backend and Vb6.0 as front end. In the database, 'ConnDate' is a field which data type is string and it stores connection date. I want to view a report (Crystal report 9) within a specific date range. I also pass values of the parameters(in Crystal report 9) from the vb6.0 program. How can I do this? Please give some help.

  12. #12
    Join Date
    Oct 2011
    Posts
    8

    cyrstal doubt

    hi

    this is pavan...i am new to crystal reports....i have a doubt..i tried to write a formula for a :

    members scheduled for an interview within 10 business days
    and i should exclude sundays in this...

    the formula is


    Select (DATEDIFF(day,b.startDate,b.Endadate) +1) - (DATEDIFF(wk,b.StartDate,b.Endadate)*2)
    - (CASE WHen DATENAME(dw,b.startdate)='SUNDAY' THen 1 else 0 end)
    - (CASE when DATENAME(dw,b.endadate)='SATURDAY' then 1 else 0 end)

    but the formula is not working...can anybody suggest me...

    thanks in advance...

  13. #13
    Join Date
    Oct 2012
    Posts
    1

    Help

    Quote Originally Posted by Rogue412 View Post
    OHH!

    That's easy!

    Modify the existing formula to this:

    //{@DateRange}

    WhilePrintingRecords;
    DateTimeVar date1;
    DateTimeVar date2;
    date1:=Minimum ({?DATE RANGE});
    date2:=Maximum ({?DATE RANGE});
    "Report For Period: " + totext(date1) + " To " + totext(date2)



    {?DATE RANGE} would be the name of your date range parameter. Hope this helps.
    Hi There

    I was wondering if you could help me out with a 3 part varible formula. I used the following formula in Crystal Reports 11:

    If {EMSH_SAL_JOB_HISTORY.EMP_NUMBER} = Next({EMSH_SAL_JOB_HISTORY.EMP_NUMBER}) then
    if Next ({@EmpID_Position}) <> {@EmpID_Position} then
    {EMSH_SAL_JOB_HISTORY.ACTION_DATE}

    But when I go to create a minimum summary on this formula I get the error message "This field cannot be summarized". Please help. Thanks in advance.

Posting Permissions

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