Query for last 8 days results

any body have a query for last 8 days results
TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) this is resulting only 1 day results only .if i execute this query is it displaying 8th back day results only.
i want all 8 back days results .
anybody have query for this...
Edited by: user12255470 on Apr 28, 2010 7:19 AM

This works fine for me:
SELECT "D0 Time"."T00 Calendar Date" saw_0, "F1 Revenue"."1-01 Revenue (Sum All)" saw_1 FROM "Sample Sales" WHERE "D0 Time"."T00 Calendar Date" BETWEEN TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) AND TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE) ORDER BY saw_0
regards
John
http://www.obiee101.blogspot.com/

Similar Messages

  • How to find top utilized query for last two months in oem

    how to find top utilized query for last two months in oracle enterprise manager?

    Can you mark the thread as Helpful  and once marked the information can be reviewed by other customer for similar queries
    Regards
    Krishnan

  • Variable for last day of last month....

    Hi,
    Can somebody let me know the code to find the last day of last month from the query variable.
    Is there any standard/business content  variable available for this?
    I have found one similar variable , but its for the posting date.
    Any help is appreciated.
    Regards...

    Check this code:
    l_date_from = sy-datum.
           l_date_from+6(2) = '01'.
           l_date_from = l_date_from - 1.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
           l_s_range-low = l_date_from.
           l_s_range-high = space.
           APPEND l_s_range TO e_t_range.
    You can modify based on your specific requirement.
    Regards,
    Kams

  • UDF for last day of week/month

    Input is a Date(For example: 2010/03/12) in String  format.
    I need to extract the last day of that week and return it as a string output.
    For example if input is 2010/03/12 and thatu2019s a Thursday my output should be 2010/03/14 i.e Saturdayu2019s date.
    Similarly I need to extract last day of month too.
    Thanks in advance
    Soumen...

    Hi,
    I did not develop this one... but just use "search" button on roseindia and you will have the answer (I think):
    [http://www.roseindia.net/java/beginners/DayOfYearToDayOfWeek.shtml|http://www.roseindia.net/java/beginners/DayOfYearToDayOfWeek.shtml]
    and do not forget that Google is your friend...
    do a research with : Java last day of week, and you have plenty of examples.
    Thanks.
    P.S: Say us when you will solved your problem.

  • Dynamic Variable for last day of month

    Hi all,
    I have created one report where in YTD is calculated based on stsyem date. NOw in this report the cal month is in row thus displaying data month wise. But i need one key figure which giving the last day vaue of every month that are displayed in YTD i.e this is based on cal day. Thus the report layout is as follows:
    if report is run in mar 2007 then it should display:
    calmonth            key figure due amount
    Jan 07                this should show due value on last day of jan 07 (i.e 31st jan 07)
    Feb 07               this should show due value on last day of feb 07 (i.e 28th feb 07)
    Mar 07               this should show due value on last day of mar 07(i.e 31st mar 07)
    customer exit variable can give me only one value at a time. How can I make it dynamic to take last day value of every month as per cal month. Could anybody explain me if worked on any such issue.
    If there is some how to paper kindly mail me at my email Id : [email protected]
    thanks in advance
    Regards,
    Wrushali

    Hi,
    We can assign multiple single values to the customer exit.
    So in the Query take CALMONTH in rows.
    And take your KF in column with Customer exit variable restriction on CALDAY.
    So in the code of this Cusotmer exit varible, from the Current date find out the year of the current date and then assign those 12 required days to this variable.
    With rgds,
    Anil Kumar Sharma .P

  • Query for last four rows?

    please write query for get the last four rows from a table

    ratnakar wrote:
    please write query for get the last four rows from a tablelast 4 rows is indeterminate.
    rows in a table are like balls in a basket.
    which are last 4 balls in any basket?
    Handle:     ratnakar
    Email:     [email protected]
    Status Level:     Newbie
    Registered:     Aug 27, 2012
    Total Posts:     34
    Total Questions:     16 (11 unresolved)
    why so MANY unanswered questions?

  • Select statement for last day of the last quarter and first quarter

    Anybody provide me the single select statement which should result the last day of the last quarter and last day of current quarter?
    Ex: Select last date of the last quarter,last day of current quarter from XYZ(DUAL...)
    Thanks in Advance

    Hi,
    Here's one way:
    SELECT               TRUNC (SYSDATE, 'Q') - 1     AS prev_qtr_end
    ,     ADD_MONTHS ( TRUNC (SYSDATE, 'Q') - 1
                 , 3       
                 )                    AS this_qtr_end
    FROM    dual;TRUNC (dt, 'Q') returns the first day of the quarter containing dt.
    Subtract one day from that, and you have the last day of the previous quarter.
    Add 3 months to that, and you have the last day of the current quarter. ADD_MONTHS (dt, n) will always return the last day of a month if its first argument, dt, is the last day of a month.

  • Query for last 5 Purchase Price for items

    Dear All
    I was trying to write a query in which
    i want to display Items with last 5 purchase price
    itemcode     UOM      Last Purchase Price        II Last Pur Price       III Last Pur Price        IV Last Pur Price         V Last Pur Price
    but not getting right result because of future posting and post date entries as I am considering Max(DocNum) for Query.
    SELECT distinct a.ItemCode, a.invntryUom
    , (select Price from PCH1 where itemcode=a.itemcode and
    docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode)) as 'II Pur. Price'
    , (select Price from PCH1 where itemcode=a.itemcode and
    docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode))) as 'II Pur. Price'
    , (select Price from PCH1 where itemcode=a.itemcode and
    docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode)))) as 'III Pur. Price'
    , (select Price from PCH1 where itemcode=a.itemcode and
    docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode))))) as 'IV Pur. Price'
    , (select Price from PCH1 where itemcode=a.itemcode and
    docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode)))))) as 'V Pur. Price'
    , Max(b.docentry) as 'MaxDocEntry'
    FROM OPCH INNER JOIN
    PCH1 b ON OPCH.DocEntry = b.DocEntry INNER JOIN
    OITM a ON b.ItemCode = a.ItemCode
    group by a.ItemCode, a.invntryUom
    order by a.ItemCode
    Please help me on this.
    Regards
    Anubha Paliwal

    Hi........
    Try this......
    SELECT Top 5 T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Price], T3.[ItmsGrpCod],
    T3.[ItmsGrpNam] FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON
    T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T3.[ItmsGrpNam] ='[%0]' ORDER BY T0.[DocDate] desc
    Regards,
    Rahul

  • WQL Query for Last Policy Request

    I'm trying to create a collection based on workstations whose last policy request was more than 30 days ago and I'm having trouble with the query statement.  Any help would be greatly appreciated.

    You can query v_CH_ClientSummary to get last policy request and join
    v_r_system in order to get the comuter name.
    That SQL and cannot be used for building a collection ... 
    Torsten Meringer | http://www.mssccmfaq.de

  • Query for Last Communicated Time

    Hi Folks,
    I've searched the forums and I think it may be out there, but I can't find it. Simply put, I'm looking for a WQL query to list all client systems that have communicated with the SCCM server in the last 1 month (or 30 days).
    I have tried { SMS_R_System.LastLogonTimestamp < DateAdd(dd,-30,GetDate()) }, but it is not accurate.
    The "Last Activity" column/criteria looks promising, but I can't find the code to use it.
    Any help in this matter would be appreciated.
    -Bill

    Why not using the build in report: Clients that have not reported recently (in a specified number of days) 
    More information in the following thread:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/57d0a157-e7d4-40a7-93c7-24ce152afcb2/looking-for-a-report-for-sccm-client-last-contact?forum=configmgrai
    Please take a moment to Vote as Helpful and/or Mark as Answer where applicable. Thanks.

  • Query for last  n rows please

    Hi All,
    Can anybody give me a SQL Query which will select last n rows from a table.
    guess some time I see this query in this forum but forgot to note it down.
    Thanks in Advance
    [email protected]

    Hi All,
    There is a simple solution, which will be useful at some of the following cases.
    1) Find Top( or bottom) <n> rows.
    For e.g. Top 5 rows or Bottom 100 rows.
    2) Range of rows.
    For e.g. Row 11 to row 20. (which is required for displaying the dynamic pages on web search engines)
    We need to understand how Oracle processes the query.
    SQL>Select rownum, Ename, Sal from Emp;
    ROWNUM ENAME SAL
    1 A 1000
    2 B 800
    3 C 3500
    But, if we write the query in following manner, check the output to understand Oracle's query processing.
    SQL>Select rownum, Ename, Sal from Emp order by Sal;
    ROWNUM ENAME SAL
    2 B 800
    1 A 1000
    3 C 3500
    The above output makes it clear that the rownum is assigned to the array of output before sorting it.
    Therefore, if you have to use the rownum of sorted output, you will have to use the inline query.
    SQL>Select rownum, Ename, Sal from (Select Ename, Sal from Emp ) order by Sal;
    ROWNUM ENAME SAL
    1 B 800
    2 A 1000
    3 C 3500
    The above query can be used, but not for any kind of filter conditions. Please check the tricky part of this filter condition.
    SQL>Select rownum, Ename, Sal from (Select Ename, Sal from Emp ) order by Sal
    where rownum = 2;
    No rows returned.
    This is because the rownums are generated first, then the filter is applied for Each row.
    Therefore, if the rownum is 1 it is filtered out. Therefore, the second row becomes first row( rownum = 1) and again it gets filtered out.
    Therefore, here we need to use one more inline query.
    SQL>Select rnum, Ename, Sal from (
    Select rownum rnum, Ename, Sal from (Select Ename, Sal from Emp ) order by Sal)
    where rnum = 2;
    ROWNUM ENAME SAL
    2 A 1000
    Think, with this above discussion, you can generate any type of query.
    Regards.
    Yogesh D.

  • Query for Last page visit by user/session and get version # of current page

    Hi Guru's,
    Any have a query to retrive last page visited by user / session? Somewhere from apex view fir 3.0 or later version? Also looking for query to get version number of current page

    RequestCtx.getResponsibilityId() should return you the Responsibility Id &
    RequestCtx.getUserId() should return the User Id.
    As I understand RequestCtx values are always available in the JSP Page. Kindly check again.

  • Query for a value result when no rows found

    Kindly help me out when I use following query it return no record but I want 0 against this query how plz let me know
    select b.accode,decode(sum(b.debit),null,0,sum(b.debit)) op_dr,
    decode(sum(b.credit),null,0,sum(b.credit)) op_cr,
    c.actitle
    from v_mast a, v_det b, chart c
    where a.v_type=b.v_type
    and a.vouchno=b.vouchno
    and b.accode=c.accode
    and a.VOID='F'
    and a.posted_by is not null
    and a.v_date between '01-JAN-06' and '31-JAN-06'
    and b.accode in (select accode from account where open='T')
    and b.accode in (select accode from chart)
    and a.v_type in ('RN','PV','CV','RV','JV')
    and b.accode = '3050571'
    group by b.accode,c.actitle
    order by b.accode
    Result is : No rows found but is there any possibilities that it will give me following result
    Accode op_dr op_cr
    3050571 0 0

    Why not respond to the earlier threads ?
    Query
    and
    0 when no records found
    Regards,
    Rob.
    Message was edited by:
    Rob van Wijk
    PS: Of course you could do a
    <your query> union all select 3050571,0,0,null from dual
    It answers the question, but I doubt that this is what you want.

  • FDM Scripting Query for last imported source file using Batch Processing

    Hi Experts,
    I'm currently in the processing of automating the FDM load process on our version of FDM 9.3.3 using batch processing and the FDM Task Manager. Most of the process works fine including an email alert which notifies users of when a data load has taken place.
    As part of that email alert I am trying to attach the source file that has been loaded in batch processing. I have managed to get an attachment using the following FDM Script Object of:
    "API.MaintenanceMgr.fPartLastFile(strLoc, True, False)".
    But have noticed that using this only attaches the last "manually" imported file rather than the last file imported using the batch processing.
    My question is: Is it possible for someone to steer me into the right direction of either a more appropriate API or if I have missed a step in my script.
    Any help as always would be much appreciated.
    Cheers
    Pip

    Unfortunately the batch process does not work the same way as on-line. I am assuming you are using the normal batch load and not Multiload (although the batch is simisar).
    the batch file name gets recorded on the tBatchContents table, and moved to the import/batches folder under the folder for the current batch run. However, if successful the file gets deleted (and from memory does not get archived). To add the import file to the e-mail, after a successful load, i think you will need to store a copy of it prior to importing the file.

  • How to Query for last updated data in planning Cube?

    Hi,
    i want to see the last updated data with specific timestamp on one of our planning application Cube, IS it possible ?
    I have gone through application log and essbase server log but didn't get much information
    Can any one please let me know.
    Thx

    How was the data updated, if it was through planning then you can enabling data auditing and you should be able to then query the information.
    If it is was a data load then in EAS go the database, edit properties, modications, it should display data load information.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • How to show the selected item in a drop-down box......

    hi, i m using the following code for selecting from the drop-down box... <html:select property="lddate" style="width:160"> <html:options collection="load_dt" name="AlmCurrencyRiskAnalysisBO" property="load_dt" labelProperty="load_dt"/> </html:select>

  • DTP error

    Hi Gurus, I created a DTP after loading only 50 records into PSA from source system. When I click on "Execute" in the DTP, it takes me to the monitor screen and I see red lights. I drill down to see where exatly is the problem. Under RSDS Transformat

  • Error Message (-45054)

    I recently purchased macbook air and am now experiencing difficulties purchasing from the itunes store with above error message. I am operating the latest version of itunes in OS X Yosemite 10.10.1. I have run disk repair but to no avail.  If anyone

  • Skip validation in a region

    Hi, I have a taskflow which is just a search form for employee. This taskflow requires a department id so that I could limit the search of employees to certain department (for security reasons...) This search form displays input text like the list be

  • PS CC install requires CS6 and Bridge CS6 to be closed....

    I thought that CC was independent of CS6 and wouldn't conflict or change the CS6 installation? Please close the following applications to continue: - Adobe Bridge CS6 - Photoshop (Adobe Photoshop CS6)