Extract Data Based on Year and Month

My clients have taken an Oracle DB TimeStamp field and
downloaded it to Access in a TEXT field format.
Sample data: 20060401001348CS
All I am trying to do is extract data based on year and
month. I have equal to 200604*, 200604%. Have also tried to used
LIKE.
Nothing works. It just can't be that dificult. Please help.
Thanks

After breaking my inquiry down into bits and pieces the
problem is not just the LIKE, it is a combination of events. The
entire picture is this:
User selects Year from a drop down (2006), then selects month
from drop down (04). I then build a variable called
EventReport Date with the statement <cfset EventReportDate
= Session.InquiryYear & Session.InquiryMonth & "%">
It correctly displays as 200604% - When used by itself as
below, it works just fine.
WORKS
<cquery name="GetEventCount" datasource="CountyDB">
Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
CDTS
FROM aeven
WHERE CDTS LIKE '#EventReportDate#'
Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
</cfquery>
WORKS (additional WHERE criteria)
<cquery name="GetEventCount" datasource="CountyDB">
Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
CDTS
FROM aeven
WHERE ((AG_ID = '#Session.InquiryAgencyCode#') AND (CURENT =
'T'))
Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
</cfquery>
FAILS **** There is something wrong with the combination of
the WHERE clause items
<cquery name="GetEventCount" datasource="CountyDB">
Select count(AD_ID) as EventCount, TYCOD, TYP_ENG, CURENT,
CDTS
FROM aeven
WHERE ((AG_ID = '#Session.InquiryAgencyCode#') AND (CURENT =
'T')
AND (CDTS LIKE '#EventReportDate#'))
Group By AG_ID, TYCOD, TYP_ENG, CURENT, CDTS
</cfquery>
NOTE: There is not an error message, it just comes back with
zero records.
MORE LOST THAN EVER! Thanks for your help
Ron

Similar Messages

  • Alpha numeric numer ranges for Shopping Cart based on year and month

    Dear All,
    My client requirement is that Shopping cart number should be generated based on year and month specific.
    Though it is possible through smart numbering, it should generate automaticaly.
    For eg:- Shopping cart generated for March 2011 should be  1103SC00001 to 1103SC99999
                  Shopping cart generated for June   2011 should be  1106SC00001 to 1106SC99999
                  Shopping cart generated for January 2012 should be  1201SC00001 to 1201SC99999
    Is thera any badi available for this.
    Regards,
    Raju

    why dont you add this to description field?

  • Using the EXTRACT function to get year and month from date

    Hello~
    I am trying to extract the month and year using the query below but am getting the error:
    Query cannot be parsed within the Builder
    select     distinct city AS "CITY",count(MOTOR_ASSIST2.CITY) as "COUNT"
    from     "MOTOR_ASSIST2" "MOTOR_ASSIST2"
    where
    (:P53_FISCAL_YR IS NULL OR :P53_FISCAL_YR = MOTOR_ASSIST2.FY)
    *OR (:P53_MONTH IS NULL OR EXTRACT(MONTH FROM :P53_MONTH) = MOTOR_ASSIST2.DATETIME)
    OR (:P53_YEAR IS NULL OR EXTRACT(YEAR FROM :P53_YEAR) = MOTOR_ASSIST2.DATETIME))*
    GROUP BY MOTOR_ASSIST2.CITY
    ORDER BY CITY
    Can anyone help me figure out what im doing wrong?Thanks
    Deanna

    1. Whats the value of year you are passing here ??
    2. Whats the value of months you are passing here??
    Select City As "CITY", Count(Motor_Assist2.City) As "COUNT"
      From "MOTOR_ASSIST2" "MOTOR_ASSIST2"
    Where ((:P53_Fiscal_Yr Is Null Or :P53_Fiscal_Yr = Motor_Assist2.Fy) Or
           (:P53_Month Is Not Null Or :P53_Month = Motor_Assist2.Month) And
           (:P53_Year Is Not Null Or :P53_Year = Motor_Assist2.Year) And
           Datetime >= To_Date(:P53_Year||:P53_Month, 'YYYYMON') And
           Datetime > Add_Months(To_Date(:P53_Year||:P53_Month, 'YYYYMON'), 1)
    Group By Motor_Assist2.City
    Order By City
    SQL> Select Sysdate From dual Where Sysdate = To_Date('2008'||'SEP', 'YYYYMON');
    SYSDATE
    Select Sysdate From dual Where Sysdate = To_Date('2008'||'SEP', 'YYYYMON');
    SYSDATE
    SQL> Select To_Date('2008'||'SEP', 'YYYYMON') From dual;
    TO_DATE('2008'||'SEP','YYYYMON
    9/1/2008
    will give you sept 1st or 1st day of the month,
    hows the data in your datetime column or variable ???
    SQL> Select Sysdate From dual Where trunc(add_months(last_day(Sysdate),-1) +1) = To_Date('2008'||'SEP', 'YYYYMON');
    SYSDATE
    9/12/2008 3
    SQL>
    there both side of '=' yield first day of sept ...
    SQL>

  • CAML Query to get Items based on Year and Month From Date Column

    Hi All,
           * As we knew that there are default columns in calendar like Stattdate,Title,Location..etc.
            * I required the CAML Query to get the list items of calender of particular Month and Year,So that I can get number of items or evetns are in Calendar
    Can any one help me how can I do this using caml query
    Samar

    Hi Stuart,
                 Thanks for your response,I had chosen 2nd option of our above mention suggestion.But when I try to fetech the data from a calendar it is showing below error .I
    had checked the below code with oter lists by changing Type to text and it worked fine.Can you please help me how can I fetech for the calulated columns
    Error
    "One or more field
    types are not installed properly. Go to the list settings page to delete these
    fields. "
    Code:
     string year="2014";
                string month="February";
                SPSite mysite = SPContext.Current.Site;
                SPWeb myweb = mysite.OpenWeb();
                try
                    SPList mylist = myweb.Lists["Calendar"];
                    SPQuery myquery = new SPQuery();
                    myquery.Query = @"<Where>
                                          <And>
                                           <Eq>
                                             <FieldRef Name='Year'/>
                                             <Value Type='Calculated'>"
    + year + @"</Value>
                                          </Eq>
                                          <Eq>
                                             <FieldRef Name='Month'
    />
                                             <Value Type='Calculated'>"
    + month + @"</Value>
                                          </Eq>
                                         </And>
                                      </Where>";
                    SPListItemCollection totaltiems = mylist.GetItems(myquery);
                   Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
                catch (Exception ee)
                    Label1.Text = ee.Message;
                finally
                    myweb.Dispose();
    Calculated Columns
    Samar

  • How to add a new metadata field to iPhoto where new field is calculated as age in years and month based on a specific date and the date photo was taken ? I want to calculate and display the age of my two kids on every photo.

    Hi
    How can I add 2 new metadata-fields to every photo in iPhoto ?
    The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
    Exampel:
    My son is born 01.01.2010
    My daughter is born 01.01.2012
    Photo taken by data
    Aage of son
    Aage of daughter
    01.07.2011
    1 year 6 month
    not born yet
    01.01.2014
    4 year 0 month
    2 year 0 month
    I would like to be able to search by kids age and get the info displayed when doing slideshows.
    How to do this in iPhoto ?
    Any alternatives to accomplish the same ?
    Kind regards

    It can't be done with iPhoto.  There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
    However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
    If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field.  Then you can use Smart Albums to search for 1year 6 month text.
    OT

  • What is the best way to dynamically create table partition by year and month based on a date column?

    Hi,
    I have a huge table and it will keep growing. I have a date column in this table and thought of partition the table by year and month. Can any you suggest better approach so that partition will create automatically for new data also along with the existing
    data? Nothing but automatically/dynamically partition should create along with file group and partition files.
    Thanks in advance!
    Palash 

    Also this one
    http://weblogs.sqlteam.com/dang/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • EXTRACT DATA BASED ON BUDGET YEAR

    I have a scenario where I need to extract data based on the users enter the budget year.
    Our budget year is as follow:
    September,
    October,
    November,
    December,
    January,
    February,
    March,
    April,
    May,
    June,
    July,
    August
    If the users enter the budget year as 2014, I want to extract payment records from September 2013 to August 2014.
    September 2013,
    October 2013,
    November 2013,
    December 2013,
    January 2014,
    February 2014,
    March 2014,
    April 2015,
    May 2014,
    June 2014,
    July 2014,
    August 2014
    My query below only extracts payment records created for a given year which is not what I want
    DECLARE @BudgetYear Datetime
    SET @BudgetYear = '09/01/2014'
    SELECT 'REFUND' PaymentType ,pa.CreateDate,YEAR(pa.CreateDate) CreateYear, p.PaymentAmount
    FROM tblPaymentAllocation pa
    INNER JOIN tblReturn r
    ON r.ReturnID = pa.ReturnID
    INNER JOIN tblAccount a
    ON a.AccountID = r.AccountID
    INNER JOIN tblCommunity c
    ON a.Community = c.CommunityCode
    INNER JOIN tblAccountingDate ad
    ON ad.AccountingdateID = pa.AccountingDateID
    INNER JOIN tblPayment p
    ON pa.PaymentID=p.PaymentID
    WHERE YEAR(pa.CreateDate) = YEAR(@BudgetYear )
    AND p.PaymentType <> 'amended'
    AND r.ReturnType = 'refund'
    AND NOT (p.PaymentType = 'check'
    AND pa.Status = 'reversal' AND pa.PriorCredit < 0)

    Give this a go:
    SELECT 'REFUND' PaymentType ,pa.CreateDate,YEAR(pa.CreateDate) CreateYear, p.PaymentAmount
    FROM tblPaymentAllocation pa
    INNER JOIN tblReturn r
    ON r.ReturnID = pa.ReturnID
    INNER JOIN tblAccount a
    ON a.AccountID = r.AccountID
    INNER JOIN tblCommunity c
    ON a.Community = c.CommunityCode
    INNER JOIN tblAccountingDate ad
    ON ad.AccountingdateID = pa.AccountingDateID
    INNER JOIN tblPayment p
    ON pa.PaymentID=p.PaymentID
    WHERE pa.CreateDate BETWEEN CASE WHEN MONTH(GETDATE()) < 9 THEN CONVERT(VARCHAR,YEAR(GETDATE())-2)+'-09-01' ELSE CONVERT(VARCHAR,YEAR(GETDATE())-1)+'-09-01'END AND CASE WHEN MONTH(GETDATE()) < 9 THEN CONVERT(VARCHAR,YEAR(GETDATE())-1)+'-08-31' ELSE CONVERT(VARCHAR,YEAR(GETDATE()))+'-08-31' END
    AND p.PaymentType <> 'amended'
    AND r.ReturnType = 'refund'
    AND NOT (p.PaymentType = 'check'
    AND pa.Status = 'reversal' AND pa.PriorCredit < 0)
    It calculates what the range should be on the fly.

  • Field Date year and month

    Hi, 
    I'd like to get only year and month field. E.g. 201409.
    Could you please let me know how to do it?
    ddwrt:FormatDate(ddwrt:Today(),0804,1)
    Thank you. 

    Hi Denis - Can you use like:
    formatted date "=TEXT(pickdate,"m") & "/" & YEAR(pickdate)"
    http://weekbeforenext-blog.blogspot.in/2011/06/extracting-month-and-year-from-date-and.html
    -prs

  • How to compare a Date data with Current Year and Period Member on FIX

    Hi experts,
    I have a Project dim that each member is a Project (P01, P02...)
    and Account dim that stores information of the each Project (Name, Start date, Finished Date...)
    Finished Date member is in Date data type
    So how can write a IF condition below in order to compare Project Finished Date with Current Year and Period members on FIX
    FIX (@Descendants(Projects), Descendants(All Year), Descendants("Year Total")...)
    IF (@CURRMBR(Period)->@CURRMBR(Year) < Project->FinishedDate)
    Do something...
    Else
    Do something
    Please help me on this. Sorry for my bad grammar. Please ask if there is anything unclear
    Many thanks,
    Huy Van.
    Edited by: Huy Van on Jan 29, 2013 1:14 AM
    Edited by: Huy Van on Jan 29, 2013 2:24 AM
    Edited by: Huy Van on Jan 29, 2013 2:25 AM
    Edited by: Huy Van on Jan 29, 2013 6:04 PM

    Here is what I have done. Post for whom may concern later
    VAR FM; /* Finished Month of Project*/
    VAR FY; /* Finished Year of Project */
    VAR CM; /* Capture Current Month on FIX statments */
    VAR CY; /* Capture Current Year on FIX statments*/
    FIX ( @RELATIVE( "Year", 0), @RELATIVE( "Period", 0), @IDescendants( "Base Projects")....)
    FY = @ROUND( "TGHT"->"NA Contract"->"FY06"->"NA Period" / 10000, 0);
    FM = @MOD( @ROUND( "TGHT"->"NA Contract"->"FY06"->"NA Period" / 100, 0), 100);
    /* For FY13 return 13... */
    CY = @JgetDoubleFromString( @CONCATENATE( "20", @SUBSTRING( @NAME( @CURRMBRRANGE( Year, Lev, 0, 0, 0)), 2)));
    /* Set CM value based on currrent Period On FIX statement */
    IF ( @ISMBR( "Jan"))
    CM = 1;
    ELSEIF ( @ISMBR( "Feb"))
    CM = 2;
    ELSEIF ( @ISMBR( "Dec"))
    CM = 12;
    ENDIF
    IF ( CY < FY OR ( CY == FY AND CM < FM))
    Do something...
    ELSE
    Do something...
    ENDIF
    ENDFIX
    Edited by: Huy Van on Feb 19, 2013 11:10 PM
    Edited by: Huy Van on Feb 20, 2013 7:46 PM

  • How to Get the numeric equivalent of Year and Month with this format....

    Hi Experts!
    I just would like to know how to get the numeric equivalent of the Year and Month if the given format is like this....
       31-May-07
    where:
    31 is the Day
    May is the Month
    07 is the Year
    Is there a function in ABAP to do this? I wouldn't mind hardcoding for the Month, but what I'm after is the year.... they only gave me 2 digits for the year... and I would like to extract 4 digits from it... do ABAP still recognize it as '1907'? I think not...
    Please help me on this experts and Thank you in Advance!!!
    More Power!

    Hi Jayson,
    You can require 2007 or 2017 or 2027..
    or 1937 . or 1947 .. so on,
    so just put a logic based on this. Just hard code as
    lets say value is 31-May-07 (9 char field)
    Case field+7(1).
    WHEn 0.
    concatenate '200' field+8(1) into year.
    WHEN 1.
    WHEN 2.
    WHEN 3.
    jsut code like this and check the syntaxes.
    Reward points if useful.
    Regards,
    Atish

  • How to calculate year and month

    Dear Friends
    I have to make a customised report.In this report there are different buckets of one year from the year and month being entered by the user.
    For example if user is giving input value for year and month as 200912 then system has to show data in first bucket for the period 200912 to 200901.In the second bucket system will show data for period 200812 to 200801.In this way system has to show data in 11 buckets for 11 years.
    Is there any function module/BAPI in SAP through which system will calculate period of one year for different buckets for my report from the input value(year and month) being given by the user.
    Moderator message - Please see The specified item was not found. before posting - post locked and Points unassigned
    Edited by: Rob Burbank on Jan 5, 2010 11:03 AM

    Hi Satish,
    You can do this with a Standard function module.
    I am providing my code below :
    data : G_date type sy-datum.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          DATE      = sy-datum " instead of sy-datum provide
              " the select option here which user provides.
          DAYS      = C_fourty"45
          MONTHS    = C_MM    "00
          SIGNUM    = C_Negative "'-'
          YEARS     = C_YY    "00
        IMPORTING
          CALC_DATE = G_date. "G_date will have date less than 45 days
    *                         " from the day program has been executed.
    Now based upon the G_DATE, we can fetch remaining 10 buckets.
    Regards,
    Kittu
    Edited by: Rob Burbank on Jan 5, 2010 11:01 AM

  • Key Figure format in Years and Months..

    Hi,
    Is there any Key figure similar to 0SRVCLENKYF (Length of Service (in Years)) part of Headcount and Personnel Actions, which should give me value in Years and Months..?
    Thanks in Advance,
    Thanks,
    Madhu.

    For curiousity sake...if you use the FIMA_DECIMAL_MONTHS_AND_YEARS Function Module, the output that you'll get is a months and years in fractional amounts. So, how are you going to get the Years and Months from this?
    For example, if the from date is 20000101 and the to date is 20090914, the results from this Function Module will be Months = 116.42740 and Years = 9.70228. If you do use this, I'd suggest taking the whole number from passed value for years (9 in this example) and then calculate months by taking the franctional amount of the passed value for years and multiple it by 12 (0.70228 * 12), you end up with 9 Years, 8 Months (8.42736 to be exact, but you're going to want to truncate it to 8 so that when it goes above 8.5, the value doesn't become 9 when it still should be 8).

  • Year and Month calculation

    Hi
    I have created a report with two prompts, they are "Enter Start date:" and "Enter End date:" where i take date values from a calendar while prompting.
    For example:
    Start date = 10/11/2003
    End date = 10/10/2003
    If i want to display the End date means, i ll use UserResponse("Enter End Date:") in the webi reports. What should i do to calculate Year and Month from this user response value,
    i used these calculations below, but it is not working, showing me #ERROR message.
    1) ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy")     =  #ERROR
    2) FormatDate(ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy");"dd/MM/yyyy")     = #ERROR
    3) Year(UserResponse("Enter End Date:")   = The expression or sub-expression at position 6 in the 'Year' function uses an    invalid data type. (WIS 10037)
    4) FormatDate(ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy  hh:mm:ss A");"MM/dd/yyyy") =#ERROR
    so help me how to get the year and month values from prompts ?
    Thanks
    Dineshkumar

    to get the Month Value and year value in Webi
    month name
    =Month(ToDate(UserResponse("Enter End Date:");""))
    month number of the year
    =MonthNumberOfYear(ToDate(UserResponse("Enter End Date:");""))
    to get the Year Value
    =Year(ToDate(UserResponse("Enter End Date:");""))
    good luck

  • Album By Year -- and month? (Sorting when an artist has 2 albums in 1 year)

    I love having my music collection sorted by Artist and within Artist by Album by Year. This effectively presents each artists' entire catalogue as a set, with each album in the order of release date. Perfect.
    But what if an artist releases more than one album or single in a year?
    Then the sorting of Album by Year breaks down.
    Two albums in the same year appear to iTunes to have been released at exactly the same time. iTunes gives up, looks at the two albums' titles, and sorts them in alphabetical order. That's kind of lame.
    Is there some way to specify the year AND MONTH of release?
    I tried adding a decimal to the year field, figuring that would at least be close enough to get them in chronological order, but it won't accept more than 4 digits.
    The obvious workaround is to rename the albums, for example rename the second album with a "Z" so it will be forced into second place when iTunes gives up and goes alphabetical. Or, use entirely fake years. But neither workaround is proper.
    Is there any legitimate way to tell iTunes what to do?
    Gateway NX250X Windows XP Pro

    Hi, Will.
    But neither workaround is proper.
    Indeed.
    Is there any legitimate way to tell iTunes what to do?
    Unfortunately, as far as I know there is not so your workarounds seem like the best way of dealing with the situation - it's either that or eliminating artists who release more than one record in any given year from your Library. ; - )
    All I can suggest is you go to the man and let him know what you'd like to see in a future version of iTunes: http://www.apple.com/feedback/itunesapp.html

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

Maybe you are looking for

  • BSI Tax Factory 10.0 upgrade

    Hi Gurus, We are in the process of upgrading BSI tax factory 10.0. Could you please let me know what should be the start date of changes in table  VV_T5F99K2_US_BSITF for parameter BSITF

  • I am having trouble with my skype and Microsoft ac...

    I signed in with MS account. I tried to change my registered mail in profile settings, it aked my password. I tried using MS account password and it said wrong password. I forgot my skype password and i tried to recover it in another browser but it t

  • Year to Date Report (excluding current month)

    Hello, I need a formula to pick data from 01/01/2010 to the end of the previous month. I'm familiar with using Today-1 etc but require a formula that enables me to run the report at any time during the month without changing the parameters. Thanks, J

  • Customer Fields not extracted by FPBW.

    Hi, dear experts, I have a problem regarding as the extraction of open items via standard transaction FPBW. The fields about the customer information (ex: VKONT and GPART) are not extracted into the table DFKKOPBW. After a search through the OSS note

  • PROBLEMS WITH A THREAD!!!

    Hi, guys! Posted this in another forum, but no good answers... I got a class "GUI" which is calling a method in class FileCopy on a button-click. Class GUI calls -------> copy in class FileCopy The FileCopy-class looks kinda like this: public class F