Need to specify date range for query result.

Below is my query. The query as is is working fine. The columns 'totalCalls' , 'totalOrders' and 'totalSCs' are all stored by date. I have created a form where the user can specify a start and end date. How would I change this query to report within those specified dates.
<cfquery name="qZVPData_Western" datasource="xxxxxx">
SELECT UserID,
       TMName,
    UserZone,
    AVG(WeekCallGoal) AS WCG,
    AVG(QTCallGoal) AS QTCG,
          (SELECT COUNT(*)
           FROM Sales_Calls
           WHERE Sales_Calls.UserID = u.UserID) as totalCalls,
    (SELECT COUNT(*)
     FROM Orders
     WHERE Orders.UserID = u.UserID) as totalOrders,
    (SELECT SUM(Quantity)
     FROM ProductOrders PO
     WHERE PO.UserID = u.UserID AND PO.NewExisting = 1) as newItems,
    (SELECT SUM(NewExisting)
     FROM  ProductOrders PO_
     WHERE PO_.UserID = u.UserID) as totalNew,
    (SELECT COUNT(ServiceCall_ID)
     FROM  ServiceCalls SC
     WHERE SC.UserID = u.UserID) as totalSCs,
    (SELECT COUNT(UserID)
     FROM  TMStatusLog TSL
     WHERE TSL.UserID = u.UserID AND TSL.Status = 'Vacation') as TSLdays1,
    (SELECT COUNT(UserID)
     FROM  TMStatusLog TSL
     WHERE TSL.UserID = u.UserID AND TSL.Status = 'TradeShow') as TSLdays2,
    (SELECT COUNT(UserID)
     FROM  TMStatusLog TSL
     WHERE TSL.UserID = u.UserID AND TSL.Status = 'Admin Day') as TSLdays3,  
    SUM(TSLdays1)+(TSLdays2)+(TSLdays3) AS TSLdays,   
    SUM(totalOrders)/(totalCalls) AS closePerc,
    SUM(totalOrders)/(totalCalls) - (.30) AS GRV,
    SUM(totalSCs)+(totalCalls)-(QTCG) AS PerVar,
   (SUM(totalSCs) + totalCalls + (TSLdays*WCG/5))/QTCG AS PerCalls
FROM Users u
WHERE UserZone = 'Western'
GROUP BY UserZone, UserID, TMName
</cfquery>
I figured I could add this to the columns WHERE statements;
'AND Column BETWEEN #FORM.Start# AND #FORM.End#' but this isn't working.
Any ideas???

What is the SQL being generated by your <cfquery> contents?  Is it valid SQL?  This is always the first thing to check when you get SQL errors back from the DB... check what you're sending to the DB.
Second: don't hard-code dynamic values into your SQL string, pass them as parameters.
Re all the subqueries: it runs fine in dev. Have you tried to load test it?  If poss move your subqueries to the FROM statement, as then they're only run once per recordset. As opposed to once per row of the result set, when the subqueries are in the SELECT or WHERE statement.
Adam

Similar Messages

  • EasyDMS - search by date range for characteristics of type date

    Hi Folks,
    I have a characteristic of type date in the additional data of a DMS document. If I enter the date (for example validity date) as 08/31/2009 and search using cv04n and give a date range for the characteristic (i.e. 01/01/2009 - 12/31/2009), the search result will bring up the document.
    However, I cannot do this from the EasyDMS find function. I need to specify an exact date. This is not very helpful for user who need to find documents with a validity date between 01/01/2009 - 12/31/2009 for example. Is there a way users can search for date range in EasyDMS find function?
    Thanks,
    Lashan

    To search a date range with EasyDMS Client you have to set the registry key
    \HKEY_CURRENT_USER\Software\SAP\EasyDms\Generel\DateSearchPick to Value 0
    Then you can use the input field like in SAP-Gui. (01.01.2009-31.01.2009)
    If you set the value to 1 or the key is not defined you can only search for one specified date.
    If you don't find this key on your PC create it as dword.
    Maybe you must restart you PC for takeing effect.
    Hope this will help you.
    Regards Wolfgang

  • How to set a date range for date field ?

    Dear Experts,
    Scenario:
    I have a query in validating the date field in my BSP application. My application is for maintain infotype 0023 Other/Previous Employers online by employees in the company.
    As per our design we are maintaining the all employment details of the employee both ( with in the current company / previous employment outside the company) in the same infotype.
    Every employee will have a hiring date within the SAP HR system. We consider this date as the cutoff date between current and previous employment in our application. When the employee updating the details wia BSP page I need to check the following.
    Record inside current company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  greater than or equal HIRING DATE and END DATE(ENDDA) should be greater than FROM  DATE (BEGDA).
    Record outside current Company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  less than or equal HIRING DATE and END DATE (ENDDA) should be greater than FROM  DATE (BEGDA) and less than HIRING DATE.
    Technical Requirement:
    How to set a date range for date field, i.e. how we can limit the date range in a HTMLB date field? Can this it be achieved via standard functionality of HTMLB?
    Following is the code to describe date field in my application.
        <htmlb:inputField id= "ENDDA_NEW_IN"
                          type= "date"
                    doValidate= "TRUE"
                      showHelp= "TRUE"
                      disabled= "FALSE"
                         width= "183"
                         style= "cssTextAreadate"
                         value= "<%='99991231'%>"/>
    Thanks a lot in advance for your assistance and help.
    Cibinu2026
    Edited by: cibin kuruvilla on Nov 12, 2008 11:13 AM

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • Date range for key date in hierarchy

    Dear Friends,
    Is there a work around for single key date restriction for time dependent hierarchy.Bcos i can only select one key date in teh report for my hierarchy so that it will take that hierarchy which falls in this date and display the result accordingly.
    But is there a way to select the date range for key date so that more than one hierarchy can be used to display my report accrding to the time range.
    Say,i have 4 hierarchies (time dependent) like v1,v2,v3,v4 and v5 for jan 08,feb 08,mar 08,apr 08 & may 08 respectively.
    In my report,i want to display the result for the time interval say mar to May.
    So my report should diplay the result according to the 3 different hierarchies for the time period i.e.v3,v4&v5.
    How do i acheive this.
    Thanks.
    ragu

    Hi
    I think we may do with the Char with text with replecement path.
    take time char as Calmonth and set the offet value as -1 and -2 and design the report and use the hierarchies in that query.
    Am not surt it willwork but better to try with this.

  • Find date range for sick leaves

    Hi,
    Ive been trying to get readable output from HR system.
    I have added the source data into Data Model, since i had to read the data with power query. Now i have pivot table like this:
    date        workdaY?    user
    6.3.2014    Sickleave    user1
    1.2.2014    Sickleave    user2
    2.2.2014    Sickleave    user2
    5.3.2014    Sickleave    user4
    5.3.2014    Sickleave    user1
    5.5.2014    Sickleave    user1
    16.9.2014  Sickleave    user3
    7.3.2014    Sickleave    user1
    6.5.2014    Sickleave    user1
    6.3.2014    Sickleave    user4
    Is there any possible way to get some kind of find function to sort and combine the data like this:
    user1        Sickleave    5.3-7.3.2014
    user1        Sickleave    5.5-6.5.2014
    user2        Sickleave    1.2-2.2.2014
    user3        Sickleave    16.9-16.9.2014
    user4        Sickleave    5.3-6.3.2014

    One way to do this is with a VBA macro.  The following should get you started.
    As you can see looking at the macro, the original data is assumed to be on a worksheet named HRData and starts in A1.
    The results are placed on the same worksheet but starting at cell G1.  You could easily write the results to another worksheet.
    The original data is copied to a temporary worksheet for sorting (and the temporary sheet is subsequently deleted).
    A Class Module is added so we can use a User Defined Object which has the properties of the user name, start date and end date of the vacation period.
    We then cycle through the sorted data, and create a Sickleave object and add it to a collection.  If the "previous" row has the same user, and the date is one more than the previous End Date, we add one to the previous end date; if not, we
    create a new object and start another sickleave period.
    This is the data input:
    and  here are the results:
    To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
    Ensure your project is highlighted in the Project Explorer window.
    First, from the top menu, select Insert/Class Module.  Highlight the new class module in the Project Explorer; click F4, and rename it to cSickLeave
    Then paste the code below into that class module:
    =======================================
    Option Explicit
    Private pUser As String
    Private pStartDt As Date
    Private pEndDt As Date
    Public Property Get User() As String
    User = pUser
    End Property
    Public Property Let User(Value As String)
    pUser = Value
    End Property
    Public Property Get StartDt() As Date
    StartDt = pStartDt
    End Property
    Public Property Let StartDt(Value As Date)
    pStartDt = Value
    End Property
    Public Property Get EndDt() As Date
    EndDt = pEndDt
    End Property
    Public Property Let EndDt(Value As Date)
    pEndDt = Value
    End Property
    Then, from the top menu, select Insert/Module and
    paste the code below into the regular module window that opens.
    To use this Macro (Sub), <alt-F8> opens the macro dialog box. Select the macro by name, and <RUN>.
    ====================================
    Option Explicit
    Option Compare Text
    Sub SickLeave()
    Dim cSL As cSickLeave, colSL As Collection
    Dim wsSrc As Worksheet, wsRes As Worksheet
    Dim wsTemp As Worksheet, rTemp As Range
    Dim vSrc As Variant, rSrc As Range
    Dim vRes() As Variant, rRes As Range
    Dim I As Long
    'set Worksheets
    Set wsSrc = Worksheets("HRData")
    With wsSrc
    Set rSrc = .Range("A1", .Cells(.Rows.Count, "C").End(xlUp))
    End With
    Set wsRes = Worksheets("HRData")
    Set rRes = wsRes.Range("G1") 'upper left cell of results
    'Sort the HRdata on a Temp sheet
    Worksheets.Add
    Set wsTemp = ActiveSheet
    Set rTemp = wsTemp.Range("A1")
    rSrc.Copy rTemp
    Set rTemp = rTemp.CurrentRegion
    With rTemp
    .Sort key1:=.Columns(3), order1:=xlAscending, _
    key2:=.Columns(1), order2:=xlAscending, _
    Header:=xlYes, MatchCase:=False
    End With
    vSrc = rTemp.Value
    With Application
    .ScreenUpdating = False
    .DisplayAlerts = False
    wsTemp.Delete
    .DisplayAlerts = True
    End With
    'create collection for results
    Set colSL = New Collection
    For I = 2 To UBound(vSrc)
    If vSrc(I, 2) = "Sickleave" Then
    If I = 2 Then
    Set cSL = New cSickLeave
    With cSL
    .User = vSrc(I, 3)
    .StartDt = vSrc(I, 1)
    .EndDt = vSrc(I, 1)
    colSL.Add cSL
    End With
    ElseIf vSrc(I, 3) = colSL(colSL.Count).User And _
    (vSrc(I, 1) - 1) = colSL(colSL.Count).EndDt Then
    With colSL(colSL.Count)
    .EndDt = .EndDt + 1
    End With
    Else
    Set cSL = New cSickLeave
    With cSL
    .User = vSrc(I, 3)
    .StartDt = vSrc(I, 1)
    .EndDt = vSrc(I, 1)
    colSL.Add cSL
    End With
    End If
    End If
    Next I
    ReDim vRes(0 To colSL.Count, 1 To 3)
    vRes(0, 1) = "User"
    vRes(0, 2) = "workdaY?"
    vRes(0, 3) = "Date Range"
    For I = 1 To colSL.Count
    With colSL(I)
    vRes(I, 1) = .User
    vRes(I, 2) = "Sickleave"
    vRes(I, 3) = Format(.StartDt, "d.m\-") & _
    Format(.EndDt, "d.m.yyyy")
    End With
    Next I
    Set rRes = rRes.Resize(UBound(vRes) + 1, UBound(vRes, 2))
    With rRes
    .EntireColumn.Clear
    .Value = vRes
    .EntireColumn.AutoFit
    .Rows(1).HorizontalAlignment = xlCenter
    End With
    Application.ScreenUpdating = True
    End Sub
    Ron

  • Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    i am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    i exported the application from apex.oracle.com and imported it to our environment
    import went fine, but when I ran the IR page I got
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    evidently the problem is a lack of public execute on DBMS_LOB, which is used in the generated IR source.
    while waiting for the DBA to grant privs on DBMS_LOB, changing the dbms_lob.getlength call to length() fixes the IR.
    however, i am not getting the download link on the associated form page... changed templates, that's not the issue -- we'll see if that's a dbms_lob issue as well

  • APEX:Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    I am using Apex 4.2.2.00.11
    am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    336554,
    Looks like there is a 127-column limit on the number of report columns supported when using that wizard. Do you have more than that?
    57434

  • How to view complete date stamp in query result view in sql developer?

    Hi,
    In the query result, the date present in db is shown as DD-MM-YYYY format but I want to view the complete date stamp. When I view the same data in aqua data studio, I see the complete time stamp. Please let me know if I need to do some settings in Oracle SQL Developer so that complete date is shown?
    How to view complete date stamp in query result view in sql developer?
    Thanks in advance,
    Vineet

    864793 wrote:
    Hi,
    In the query result, the date present in db is shown as DD-MM-YYYY format but I want to view the complete date stamp. When I view the same data in aqua data studio, I see the complete time stamp. Please let me know if I need to do some settings in Oracle SQL Developer so that complete date is shown?
    How to view complete date stamp in query result view in sql developer?
    Thanks in advance,
    VineetAlternatively you can execute below
    set nls_date_format='DD-MM-YYYY HH24:MI:SS';Regards,
    Achyut K

  • How can I set a date range for a Date/Time Field in LiveCycle ES2?

    I need to set a specific date range for a form set up in LiveCycle ES2. Cannot see where i allows me to do that without a code entered.

    Hi,
    You can't set a start and end date for the date/time field, the best you can do is validate the range after the user has selected it.
    An alternate is to make your own date / time field, like this sample http://adobelivecycledesignercookbookbybr001.blogspot.com.au/2013/05/an-alternative-date-p icker-for.html
    Regards
    Bruce

  • Error when selecting date range in query designer

    hi all,
    when iam trying to select date range in query designer like 01.04.2009 to 10.04.2009 it has to select only that dates where as it is selecting all the dates in between those like 010.04.2009,01.03.2009,01.02.2009.why this is happening ,iam unable to understand.plzz help me in this issue.
    Vamshi D Krishna

    hi ,
    i have created a variable as you told but no use.still i have to select the dates manuallyone after the other.for more user friendly can i have a calander where i can select date ranges.is it posible to have calander for selecting date ranges instead selecting dates one by one,if posible i request you to give  the detailed steps.plzz guide me in this issue.thanks in advance.
    Vamshi D Krishna

  • BEX Query - Run time char InfoObjects manipulation for query results

    Hello Experts,
    Iam working on BEX queries to meet following requirements,
    1)  Display only first 2 char of an InfoObject in the query results. Actual infoprovider has 24 char for this InfoObject. Example: Summary code FABCDXXXX.. But we want to show only 'FA' in query results
    2) We split a 120 char description into two 60 char InfoObjects, we need to concatenate the split char into one for query result display
    3) We need to show a specific hierarchy level, nothing before or after. For example: Eighth level for a cost element hierarchy.
    4) We need to show a constant in a column (which is not there in the table)
    We are planning to use both BEX analyzer and Crystal for the reports.
    I read in one of the thread that we can use formula variables/Customer exit for this but iam not very clear, if you know how to do it or if you have any step by step procedure, can you please pass it to me. Thanks in advance for your help.
    Regards,
    Raman

    Thanks for quick response. We have users who need BEX analyzer, is there any way to handle the above requirments for BEX analyzer.

  • Need of additional date ranges in Campaighn

    Hi,
           Can any one please explain me the Need of additional date ranges in Campaighn.we have option of creating additional date ranges,Can any one give live example for this requirement.
    Regards
    Narayana

    Hello Manam,
    I think you can add up to 6(not sure though) additional data ranges.
    These are the dates relating to 1)Buying dates 2)Predip 3)Post dip dates
    4)Promotion dates.
    Promotion dates are the dates that are used in TPM where the stock reaches retailer and shelves them and starts selling the good for a promotional price and the price ends on the Promotion end date.
    Please reward if this helps.
    regards,
    Muralidhar Prasad.C

  • Date Range for a fixed fiscal year

    Dear All,
    How to write a code to fix the date range for 12months only. Example like mine selection should be between one fiscal year only.
    I have check that the date is of one year range like 1.05.2008 to 30.04.2009
    month bt 05 & 04 for one particular year. how to write the code.

    hi,
    check for the year like this.
      if v_date1(4) EQ v_date2(4).
      endif.
    this will check for the first 4 characters of the date string which is the year.
    regards,
    Peter

  • Need to assign number range for MMR

    Dear All,
    Need to assign number range for material as MB00001 to MB99999.
    How to do this
    Rgds
    Francis

    Hi,
    USe Tcode MMNR,
    you assign number range to a group
    then youassign material type  to this group
    you have to respect these two rules
    "No overlaps between internal and external number assignement for a given groups"
    "No overlaps between intervals of different groups"
    regards
    regards

  • Date range related query needed

    I have table 'ratemast' with following columns and data
    begindate      enddate           rate1
    01-12-2006      10-12-2006     750.00
    11-12-2006      25-12-2006     950.00
    26-12-2006      02-03-2007     1500.00
    the data in begindate and enddate may fall between any date range.
    it may be for a week or for a month or even more than that.
    i need a query to do the following:
    my query will have begindate and enddate for any date range which is not defined in a single row of ratemast.
    I need to pick indiviudal date and its respective rate and sum them and it should be divided by number of days.
    eg:- if begindate: 09-12-2006 enddate: 13-12-2006
    result should be : (750+750+950+950+950)/5
    Please help.

    Hi,
    Here's one way... you may have to alter it to check for count(*) = 0 or any other corner cases.
    [email protected](152)> create table ratemast(begindate date, enddate date, rate number);
    Table created.
    Elapsed: 00:00:00.22
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-01', date '2006-12-10', 750);
    1 row created.
    Elapsed: 00:00:00.01
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-11', date '2006-12-25', 950);
    1 row created.
    Elapsed: 00:00:00.00
    [email protected](152)> insert into ratemast(begindate, enddate, rate)
    values (date '2006-12-26', date '2007-03-02', 1500);
    1 row created.
    Elapsed: 00:00:00.00
    [email protected](152)> commit;
    Commit complete.
    Elapsed: 00:00:00.04
    [email protected](152)> select * from ratemast
      2  /
    BEGINDATE ENDDATE         RATE
    01-DEC-06 10-DEC-06        750
    11-DEC-06 25-DEC-06        950
    26-DEC-06 02-MAR-07       1500
    Elapsed: 00:00:00.03
    [email protected](152)> var begin_date varchar2(10);
    [email protected](152)> var end_date varchar2(10);
    [email protected](152)> exec :begin_date := '2006-12-09';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> exec :end_date := '2006-12-13';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> @ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select dates.d
      7  , r.rate
      8  from dates
      9  , ratemast r
    10* where dates.d between r.begindate and r.enddate
    [email protected](152)> /
    D               RATE
    09-DEC-06        750
    10-DEC-06        750
    11-DEC-06        950
    12-DEC-06        950
    13-DEC-06        950
    Elapsed: 00:00:00.02
    [email protected](152)> ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select :begin_date
      7  , :end_date
      8  , avg(r.rate) as fee
      9  from dates
    10  , ratemast r
    11  where dates.d between r.begindate and r.enddate
    12* group by :begin_date
    [email protected](152)> /
    :BEGIN_DATE                      :END_DATE                               FEE
    2006-12-09                       2006-12-13                              870
    Elapsed: 00:00:00.01
    [email protected](152)> exec :end_date := '2007-01-15';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    [email protected](152)> @ed
    Wrote file TEST.BRANDT_152_20070315151840.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select dates.d
      7  , r.rate
      8  from dates
      9  , ratemast r
    10* where dates.d between r.begindate and r.enddate
    [email protected](152)> /
    D               RATE
    09-DEC-06        750
    10-DEC-06        750
    11-DEC-06        950
    12-DEC-06        950
    13-DEC-06        950
    14-DEC-06        950
    15-DEC-06        950
    16-DEC-06        950
    17-DEC-06        950
    18-DEC-06        950
    19-DEC-06        950
    20-DEC-06        950
    21-DEC-06        950
    22-DEC-06        950
    23-DEC-06        950
    24-DEC-06        950
    25-DEC-06        950
    26-DEC-06       1500
    27-DEC-06       1500
    28-DEC-06       1500
    29-DEC-06       1500
    30-DEC-06       1500
    31-DEC-06       1500
    01-JAN-07       1500
    02-JAN-07       1500
    03-JAN-07       1500
    04-JAN-07       1500
    05-JAN-07       1500
    06-JAN-07       1500
    07-JAN-07       1500
    08-JAN-07       1500
    09-JAN-07       1500
    10-JAN-07       1500
    11-JAN-07       1500
    12-JAN-07       1500
    13-JAN-07       1500
    14-JAN-07       1500
    15-JAN-07       1500
    38 rows selected.
    Elapsed: 00:00:00.01
    [email protected](152)> ed
    Wrote file TEST.BRANDT_152_20070315150352.sql
      1  with dates as (
      2     select to_date(:begin_date, 'YYYY-MM-DD') + level - 1 as d
      3     from dual
      4     connect by level <= to_date(:end_date, 'YYYY-MM-DD') - to_date(:begin_date, 'YYYY-MM-DD') + 1
      5  )
      6  select :begin_date
      7  , :end_date
      8  , avg(r.rate) as fee
      9  from dates
    10  , ratemast r
    11  where dates.d between r.begindate and r.enddate
    12* group by :begin_date
    [email protected](152)> /
    :BEGIN_DATE                      :END_DATE                               FEE
    2006-12-09                       2007-01-15                       1243.42105
    Elapsed: 00:00:00.01
    [email protected](152)> cheers,
    Anthony

Maybe you are looking for

  • My "Mac Help" on my Mac Mini does not work!

    I have a Mac Mini, OS X 10.3.9. When I go into Mac Help, nothing happens when I try to ask questions, and I experience other problems when I try to go through Mac Help's library. And sometimes it works as if nothing was wrong. It's just plain sick. I

  • OS Command in File Adapter

    Hi All, I am trying to encrypt a file from XI and FTP to a different location. I am using PGP software for encryption and decryption. I am able to encrypt/decrypt the file from the OS level. The command I am using at OS level is: pgp --home-dir /.pgp

  • Modify a Table View Header

    I need to modify the header of a tableview and I've tried this: .table-view {     -fx-background-color: rgb(70,70,70);     -fx-text-fill: white;     -fx-border-style: solid;     -fx-border-color: transparent; /*    -fx-border-insets: 0 1 1 0, 0 0 0 0

  • RTP300-NA v1.1 slow to some web sites with Vista (XP ok)

    I have a RTP300-NA VoIP router (v1.1) which works perfectly with Windows XP, but not with Windows Vista. With Vista some web sites work OK, while others have a ~2 min delay. These web sites appear completely and quickly after the initial 2 min. It se

  • Reg validations and assignments

    Hi All Im new to MDM and need to clarify some basic doubts.... What is the deifference between validations and assignments and what is their significance , and SAP MDM is the third party tool and who is the atual vendor for this. Points rewarded for