Dates on reports

bRahmsbRahms Member Posts: 44
This is what we should develop:
In the requestform the user can specifie a date (even in the past). Then when he gave a date the enddate should be the end of that month and the begindate the beginning of the given month.

So f.e.: When he gave up 05/03/07, the startdate should be 01/03/07 and the enddate should be 31/03/07.

Next thing is that the report has to show al the FileID's that has been openend in March 2007.

To admit.. i don't have any clue how to begin on this and since we're running out of time, I don't have time to take a course to finish this task. Anyone willing to help?

Answers

  • AlbertvhAlbertvh Member Posts: 516
    Hi

    1) BeginDate := CALCDATE('<-CM>',RequestDate); // Begining of Month
    EndDate := CALCDATE('<+CM>',RequestDate); // End of Month

    2) Not sure what you mean by fieldid :?:


    Regards
    Albert

    Sorry FielID's
  • bRahmsbRahms Member Posts: 44
    An example will sort things out:

    I've got in tblFile a PK set on FileID and i have a FileDate (= the date the file is made).
    File ID FileDate
    1 11/02/07
    2 24/02/07
    3 03/03/07
    4 12/03/07
    5 01/04/07

    So when the user gives in the requestform of the report: 05/03/2007, and he pushes OK, then we should get a report of alle the FileID's who had been made in March -> FileID's 3 and 4.
  • AlbertvhAlbertvh Member Posts: 516
    Ok on the report
    set dataitem to tblFile and on on properties selct
    ReqFilterFields and put FileDate

    in OnPreDataItem Section and the code that I gave you in my first reply :D


    <Edit>
    after the set start and end dates
    SETRANGE(FileDate,StartDate,EndDate);

    Regards
    Albert
  • bRahmsbRahms Member Posts: 44
    Thx for the help! It works fine now :D
Sign In or Register to comment.