Saturday, May 19, 2012   
 Search   
 

http://www.foxfirereporting.com
Register  Login  
Forums  
      
 Forums    
SearchForum Home
  Support  Foxfire! 8+ Support  Filtering / dat...
 Filtering / date field comparison
 
 6/30/2009 10:35:25 AM
manhaveh
23 posts
www.jackson-lloyd.com


Filtering / date field comparison

Thanks for the previous help.  I now have a data item defined as: CTOD(STRTRAN(TRANSACT.DATE,"/A","/0")).

That works perfectly in my report as far as display of the data.  It returns TR_DATE which has a data type of Character.  It may be more practical to have it as data type 'Date', but I cannot figure out how to change that.  The returned format when displayed in a report is 06/20/2009 which is very nice.

 

I need to filter on that data item.  I enabled filtering.  The format is given as @! But nowhere in the developer help, output formats, does it show what that means.  So I changed it to @D.  This did have result in that when I completed the filter field I had to enter a date as mm/dd/yyyy.  That is good.  But I got no results when looking for TR_DATE is after 06/01/2009. 

 

What do I modify.  I need this to work.  Usually I would want to run the report for sections of dates.  5/1/09 thru 5/31/09, 6/1/09 thru 6/30/09, 4/1/09 thru 6/30/09 etc.  The report works except that the filtering doesn't.

 

I pasted the SQL error below.  I have tried modifying data types, but that has not helped the situation.

 

Thanks,

 

Hans Manhave

Jackson-Lloyd

hmanhave@jackson-lloyd.com

 

 

SELECT        DISTINCT;

        PADR(UPPER(LTRIM(RTRIM(SUBSTR(DATA11,213,25)))),24) AS CH_MEMBER,;

        TRANSACT.TBAL,;

        TRANSACT.TYPE                  AS TYPE_T0,;

        PADR(CTOD(STRTRAN(TRANSACT.DATE,"/A","/0")),10) AS TR_DATE,;

        APCUSTM2.POL_IDX,;

        INS.NAME,;

        PADR(SUBSTR(APCUSTM2.POL_IDX,7,1),4) AS APCUSTM2_AGCY,;

        TRANSACT.ITEM,;

        TRANSACT.MONTH,;

        TRANSACT.TRANS,;

        TRANSACT.AMT                   AS AMT_T;

  FROM           "APCUSTM2" APCUSTM2;

                        INNER JOIN "TRANSACT" TRANSACT ;

                ON LEFT(APCUSTM2.POL_IDX,9) = LEFT(TRANSACT.POL_IDX,9) ;

                        INNER JOIN "POLICY" POLICY ;

                             INNER JOIN "INS" INS ;

                     ON LEFT(POLICY.POL_IDX,7) = INS.REC ;

                ON LEFT(APCUSTM2.POL_IDX,9) = LEFT(POLICY.POL_IDX,9) ;  INTO  CURSOR CHAMBERLIST;

  WHERE       (SUBSTR(APCUSTM2.POL_IDX,7,1)="7";

     AND UPPER(LTRIM(RTRIM(SUBSTR(DATA11,213,25))))<>"                        ";

     AND TRANSACT.BCO == "GEM";

     AND TRANSACT.TRANS IN ("NTO","TE1","TE3");

     AND TRANSACT.TBAL=0.00;

     AND CTOD(STRTRAN(TRANSACT.DATE,"/A","/0"))>"06/01/2009");

  ORDER BY  1

** (ORDER BY with field names)...

** ORDER BY            CH_MEMBER

 

 7/2/2009 9:32:34 AM
AndrewM
149 posts
www.aksel.com
5th


Re: Filtering / date field comparison
You can change the Data Type in the Data Item Editor. It appears right under the Data Item Description. When you make this change, you should be able to put in your date ranges as you want. Since you are converting it already to a date field, that should be the only change you need to make. Please let me know if this does not help. Andrew
 7/2/2009 10:23:04 AM
manhaveh
23 posts
www.jackson-lloyd.com


Re: Filtering / date field comparison

I get a 'Operator/operand type mismatch' still.  The query runs for a while and then halts with that error.

I'm assuming that the error is caused by the SQL line:  CTOD(STRTRAN(TRANSACT.DATE,"/A","/0"))>06/01/2009)

I don't know if that last bracket is a close from the beginning of the SQL statement.

Does the CTOD function expect a date as 06/01/2009 or should it be 2009/06/01 or some other specification?

 7/2/2009 10:26:24 AM
manhaveh
23 posts
www.jackson-lloyd.com


Re: Filtering / date field comparison

I need to add that an information message is displayed when the filter is entered.  It states "this filter uses an expression. Please be sure that the value displayed is declared as a variable when the request is run."

Is that something I should set somewhere?

Thanks,

Hans

 7/2/2009 12:39:51 PM
AndrewM
149 posts
www.aksel.com
5th


Re: Filtering / date field comparison
The problem is in your request definition. The filter value was changed to an Expression instead of a value. To resolve this problem, go to the filter screen and ensure that the data type for the filter is set to Value, not Expression. It might be easier if you simply delete the filter and re-add it.
  Support  Foxfire! 8+ Support  Filtering / dat...
   
SearchSearch  Forum HomeForum Home     
 Links    
   
  
Downloaded from DNNSkins.com