Printing Date on report

nvermanverma Member Posts: 396
Hi,

This might seems like a really really stupid question. But, here it goes.

I have created a report that has an Option tab whcih includes a field called "Posting Date" (which is of type date). The user enters the Date in the Posting Date" label that he/she wishes to see on top of the report. The problem that I am facing is that, the user wants the ability to enter a range of Date. For instance:- 010101..020202.

However, whenever I try to enter a date range like above it throws an error saying
010101..020202 is not a valid date

Any idea how I can fixed this.

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
  • nvermanverma Member Posts: 396
    I am looking at report 26, they are doing it by having Starting Date and Ending Date as two different fields.

    Is it possible to do both of them in one field so it might look something like this: 010101..020202??
  • nvermanverma Member Posts: 396
    Thanks. That does let me input the Date the way I wanted it. But is there way of formating the "Posting Date".

    For example if I enter:- 010101..01011 . In my Report it shows it the exact same way. However, is it possible to format it so it would show January01,2001 - January01,2011

    Posting Date is off type text.
  • nvermanverma Member Posts: 396
    This is what I am thinking: For date:- 010101..010111

    I can Try to use COPYSTR function to seperate values into date, month and year.

    Just create bunch of Text boxes and put the info into them.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Try this

    TempGLAcc.SETFILTER("Date Filter",DateFilter);
    
    Message('%1 - %2',
      FORMAT(TempGLAcc.GETRANGEMIN("Date Filter"),0,'<Month Text> <Closing><Day>, <Year4>'),
      FORMAT(TempGLAcc.GETRANGEMAX("Date Filter"),0,'<Month Text> <Closing><Day>, <Year4>'));
    

    TempGLAcc is of type record 15 (Dont forget to set temporary to Yes )
  • FDickschatFDickschat Member Posts: 380
    Instead of the way report 27 works with the date filter you could use a DataItem in your report and display the date filter from that data item, e.g. use GLAccount and display field Date Filter as a request form filter field (example Report 4).

    Maybe your DataItem in your report already has a DateFilter field or a Date field you can use to have the user enter the filter.
    Frank Dickschat
    FD Consulting
  • nvermanverma Member Posts: 396
    Thanks Mohana. I got it to work. I just had to modify the code a little bit.
    TempGLAcc.SETFILTER("Date Filter",PostingDate);
    
    PostingDate2 := FORMAT(TempGLAcc.GETRANGEMIN("Date Filter"),0,'<Month Text> <Closing><Day>, <Year4>');
    PostingDate1 := FORMAT(TempGLAcc.GETRANGEMAX("Date Filter"),0,'<Month Text> <Closing><Day>, <Year4>');
    PostingDate3 := '-  ' + PostingDate1;
    IF PostingDate2 = PostingDate1 THEN
      PostingDate3 :='';
    
Sign In or Register to comment.