To find last year's data / a particular year's data

Hi ,
How to find out the data for the entire last year , i tried like
entered_date between to_char( '12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
and to_char('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS' ) , but it is an invalid number error.
thanks.

Hi,
If you want something that doesn't require hard-coding a year, but automatically figures out what year it is:
WHERE   entered_date     >= ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                          , -24
AND     entered_date     <  ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                          , -12
                                )There are a couple of things to notice about the expression you posted (besides using TO_CHAR instead of TO_DATE):
WHERE  entered_date     BETWEEN TO_DATE ('12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
                      AND       TO_DATE ('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS')BETWEEN includes both endpoints, so the expression above covers a tiny bit more than one year. It includes one second from 2008 and one second from 2010, as well as all of 2009.
Currently 2010 is the last year, so the expression you posted (as well as my suggestion) is actually for the year before last year, but it can easily be changed for any year.

Similar Messages

  • How To Find Last Row With Data +2, Then Format?

    I need to find the last row +2, select the range A:L, then format.
    Could someone please supply the code?  I can handle the format part.
    Thanks!
    A. Wolf

    Works great!
    I need to do 2 other things:
    1) Add a text value to r in A: & center over selection A:L
    Dim r As Long
        r = Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
           USED THIS BUT ENDING UP IN MIDDLE OF L:!
        ActiveCell = Range("A" & r)
        ActiveCell.Value = "Estimated True Up Total"
    2) 2) Format a total in r as currency/2 decimels/aligned to right.
    THANKS AGAIN!!!
    A. Wolf

  • LAST GOODS MOVEMENT DATE wise report

    Hi MM Experts
    Is there any report through which we can find LAST GOODS MOVEMENT DATE ( goods receipt , issue date ).
    i have tried MC.2 but in this report material , plant and sloc description is coming , i want code so that we can understand easily.
    regards
    anubhav

    Hi,
    To get the plant, material code with description in MC.2 transaction.
    Please following below steps:
    on output screen >>>
    settings >> Characteriastics display >>> select key and description or only Key.
    Regards,
    Shailesh Mackwan

  • How you will see reports last year and till date reports and compare?

    How you will see reports last year and till date reports and how you will compare?
    sridhar

    Hi.
        This you can achieve at query level.
    I have few question.. First let me know how many KFs you have in the query and based on what characteristic you want to compare the KFs.
    Let me assume that you want to compare "SALES" KF for the last and current year.
    1) Add the "SALES" KF to the Query.
    2) Rename it as "SALES - Prior Year"
    3) Copy the above KF and rename the new KF as "SALES - Current Year"
    4) In the "SALES - Prior Year", add the date (say, Calendar Date, Fiscal Period, etc.) as per yr requirement. Keep offset as "-1"
    5) Do the same for "SALES - Current Year" . No offset.
    6) Now create a new formula to find the difference between "SALES - Prior Year"  and "SALES - Current Year" .
    Hope you got some idea!!
    Let me know if anything more is required.
    Regards,
    Balaji V

  • How do I pay for my storage plan when I don't have a credit card? Last year I used an iTunes voucher but can't find that option this year. Please help!

    How do I pay for my storage plan when I don't have a credit card? Last year I used an iTunes voucher but can't find that option this year. Please help!

    Create an iTunes credit by redeeming a gift card and it will be charged to your credit.  From http://support.apple.com/kb/ht4874:
    "payment methods accepted include iTunes store credit, credit cards, and debit cards"

  • How do i find out the tables (data)effected in a schema after a particular time stamp

    how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
    pls email in [email protected]

    You can't do that. That would be a real security risc.
    /KAj

  • Parameter for Last Week, Last Month & Last Year from the current Date

    I have a crystal report that has a StartDate & EndDate parameters from the stored procedure that I am calling. Now i got a new requirement saying that my user wants a drop-down parameter in which they need to be able to select last week (Sunday to Saturday), last month, last year instead of manually selecting start date and end date parameters? Can anyone please explain me how to do this?
    (FYI, I am using Crystal 2008)

    Hi Naveen,
    You'll need to handle the logic in the Stored Proc's where clause.
    If you're using oracle, I have something like this in the Stored Proc's where clause for our reports:
    Where {Date_Field} Between
    Decode('{?Relative Date}',
    'Yesterday', sysdate - 1,
    'Last Week', Tunc(sysdate, 'IW')-7)
    AND
    Decode('{?Relative Date}',
    'Yesterday', sysdate,
    'Last Week', Tunc(sysdate, 'IW'))
    where 'Relative Date' is a prompt in the Stored Proc and 'yesterday'. 'last week' are the 'static values' in the prompt.
    -Abhilash

  • I bought a pdf book last year and had no problem reading it for a few months then all of a sudden I could no longer open it and to this day. Any other pdf download off internet I can still open and read, except for that particular book. Operating system i

    I bought a pdf book last year and had no problem reading it for a few months then all of a sudden I could no longer open it and to this day. Any other pdf download off internet I can still open and read, except for that particular book. Operating system is Windows 7 Home Premium, Adobe Reader XI 11.0.07.  When trying to open file I get msg "You did'nt login or your session has expired. Please log in to read this document for the first time". (Like I said I have read it before). So I log in but that prompts me to give the name of the file I want to export or convert to Word or something else, which is not what I want to do of course. I have not purchased any service from Adobe or Acrobat as I only need to read. Thanks for your help..

    Thank you for your reply. Operating system is Windows 7 Home Premium, Adobe Reader XI 11.0.07.  When trying to open file I get msg "You did'nt login or your session has expired. Please log in to read this document for the first time". (Like I said I have read it before). So I log in but that prompts me to give the name of the file I want to export or convert to Word or something else, which is not what I want to do of course. I have not purchased any service from Adobe or Acrobat as I only need to read. Thanks for your help.

  • Just bought a new iphone 5 i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac aga data 0

    Just bought a new iphone 5, i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac again?)

    You an use your iPhone without connecting it to a computer.
    But the product description for the iPhone clearly states that in order to sync with a Mac you must have OSX 10.6.8 or later. That version of the OSX is usually called Snow Leopard. There are two mo recent versions of OSX. OSX 10.7.x (Lion) and OSX 10.8.x (Mountain Lion).
    If you can upgrade your computer to at least Snow Leopard I suggest you do so.

  • Mavericks install failed on my late 2008 MBP. Says I should contact the software provider. Want to do a system restore, using Time Machine, but latest date to use is from last year - even tho did a backup before the download?

    I downloaded the free Mavericks upgrade to my late 2008 MBP on Friday.  I made sure to plug in my external hard drive so that Time Machine could back up beforehand.  (I should say I'm not clear about the different kinds of backups that Time Machine does - I just plug it in and let it go.).
    So have tried several times over the weekend to install, it takes 46 minutes each time - only to tell me it can't do it.  There was an error message of needing to contact the software provider (or something similar).  After searching the internet (on my husband's computer - since my MBP is rendered useless right now) I decided maybe I should wait on Mavericks and just do a system restore.  However, when I plugged in the Hard Drive and proceed to System Restore, the latest date available is one from September of 2012 (14 months ago)...  I've wondered if the date might be wrong?  But I'm afraid to choose it because I'm not sure what I would lose.  It might take me back to Snow Leopard rather than Lion... (however, the version on Restore was 10.8.1 which is Mtn Lion, right?  Even tho it was last year...)
    Some sources online say that I should go into applications and delete the install -- but I can't get to anything on my computer. 
    I tried to do a reboot in safe mode - but not sure if it worked... 
    I did look on the installer log error and the latest error is: 
    Local Host  Report crash [378]
    Can anyone help me?  (Using simpleton, non-techie language?
    Thanks

    I downloaded the free Mavericks upgrade to my late 2008 MBP on Friday.  I made sure to plug in my external hard drive so that Time Machine could back up beforehand.  (I should say I'm not clear about the different kinds of backups that Time Machine does - I just plug it in and let it go.).
    So have tried several times over the weekend to install, it takes 46 minutes each time - only to tell me it can't do it.  There was an error message of needing to contact the software provider (or something similar).  After searching the internet (on my husband's computer - since my MBP is rendered useless right now) I decided maybe I should wait on Mavericks and just do a system restore.  However, when I plugged in the Hard Drive and proceed to System Restore, the latest date available is one from September of 2012 (14 months ago)...  I've wondered if the date might be wrong?  But I'm afraid to choose it because I'm not sure what I would lose.  It might take me back to Snow Leopard rather than Lion... (however, the version on Restore was 10.8.1 which is Mtn Lion, right?  Even tho it was last year...)
    Some sources online say that I should go into applications and delete the install -- but I can't get to anything on my computer. 
    I tried to do a reboot in safe mode - but not sure if it worked... 
    I did look on the installer log error and the latest error is: 
    Local Host  Report crash [378]
    Can anyone help me?  (Using simpleton, non-techie language?
    Thanks

  • How to load member for "sales same date last year"?

    I need to load a member in Measures named "PriorYrSales" with "Sales" for the same date last year as today's date. Thus, retrieving "PriorYrSales" for 2/10/2002 would return the sales amount for 2/10/2001. Since days roll-up to months, quarters, years, it would be easy to determine how we're doing compared to the same time last year.Data is loaded each day for a date range from the current date and the preceding x days. Substitution variables are available for the beginning and ending date and the same dates for last year.For example: Data is loaded from beginning date of 2/01/2002 through ending date of 2/10/2002.The prior year date variables contain 2/01/2001 and 2/10/2001.The time period dimension is as follows:FY01->Jan2001-->01012001 (Alias: 1/01/2001)-->01022001 (Alias: 1/02/2001)-->all the dates in Jan->Feb2001-->02012001 (Alias: 2/01/2001)-->02022001 (Alias: 2/02/2001)-->all the dates in Febetc.FY02->Jan2002-->01012002 (Alias: 1/01/2002)-->01022002 (Alias: 1/02/2002)-->all the dates in Jan->Feb2002-->02012002 (Alias: 2/01/2002) -->02022002 (Alias: 2/01/2002)-->all the dates in Febetc.Thanks your any and all suggestions.Phil

    Perhaps I wasn't clear in the first post. The intent is to easily compare sales for a current date/period to the same date/period last year. Neither Excel nor Analyzer provide a method that I'm aware of to retrieve data as follows:-------------------------------------Period Sales PriorYrSales Diff4/15/2002 1,000 900 100-------------------------------------(900 is sales for 4/15/2001)(100 is the calculated difference.)Nor can I do this:-------------------------------------Period Sales Period Sales Diff4/15/2002 1,000 4/15/2001 900 100-------------------------------------What Excel and Analyzer do allow is:-------------------------------------Period Sales 4/15/2002 1,0004/15/2001 900-------------------------------------I readily acknowledge that the data is redundant but I can't think of another option that will allow Excel and Analyzer to easily retrieve the values for comparison. If the PriorYrSales member can be loaded then the users can compare years, quarters, months and days quite easily.My challenge is knowing how use a calc script to derive prior year dates that correspond to current year dates. Something like:PriorYrSales->04152002 = Sales->04152001I've considered arrays but I've never used them and the documentation is not helpful enough for me.Thanks for your response.Phil

  • I bought cs6 last year and can not find any information on my adobe account about the purchase. I need to reinstall it. How do I get a hold of adobe to get this information?

    who do I contact about finding a activation code of my CS6 i bought last year?

    Serial number and activation support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • How to find the last DML timings on any particular table in oracle 10g?

    Hi All,
    I need to know in one particular table when the last DML operation happen and what is the dml query ?
    Thanks
    Bala

    Hi;
    Please see:
    find last dml operation time on a table
    find last dml operation time on  a table
    Last DML time
    find last dml operation time on  a table
    time of last DML
    Regard
    Helios

  • To find last run date of custom concurrent program in oracle apps

    Hello Exports,
    Can you pls tell me how to find last run date of custom concurrent program in oracle apps.( thr Backend query )
    Thanks in advance,
    Edited by: 981527 on Mar 7, 2013 3:01 AM

    try the below:
    select fcp.user_concurrent_program_name
    ,fcr.request_date
    ,fu.user_name
    ,fcr.actual_start_date
    ,fcr.actual_completion_date
    ,fcr.phase_code
    ,fcr.status_code
    ,fcr.argument1
    ,fcr.argument2
    ,fcr.argument3
    from fnd_concurrent_programs_vl fcp
    ,fnd_concurrent_requests fcr
    ,fnd_user fu
    where fcp.user_concurrent_program_name like 'Payroll Run'
    and fcp.concurrent_program_id = fcr.concurrent_program_id
    and fcr.requested_by = fu.user_id
    order by fcr.actual_completion_date desc

  • Last year column data not displying

    Dear All,
    I am working on one of reporting issue where data is not getting displayed for few Last year columns. I have checked at the back end and data is available in info providers.
    I want your help to identify possible reason. I carried below trouble shooting steps.
    1: checked data in back end and its available
    2: all restrictions are proper.
    3: there no issue with query properties, I check all.
    I am doubtful about customer exit code so here it is. Please suggest me whether its good or not.
    WHEN 'ZVAR_LYCW'.
        IF I_STEP = 2.
          CLEAR LOC_VAR_RANGE.
         BREAK-POINT.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = 'ZVAR_CALDAY'.
            CLEAR : L_S_RANGE,
                    v_loc_date,
                    v_loc_date1.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
            L_S_RANGE-LOW(4) = L_S_RANGE-LOW(4) - 1. "low value previos year
            L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
            L_S_RANGE-HIGH(4) = L_S_RANGE-HIGH(4) - 1.
            v_loc_date = L_S_RANGE-LOW. "take input value in another variable
            v_loc_date1 =  L_S_RANGE-HIGH.
            L_S_RANGE-LOW =  v_loc_date.
            L_S_RANGE-HIGH = v_loc_date1. "high value = input, taken into another variable
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        endif.
    Please help.
    Thanks,
    Vishal

    Hi vishal,
    try this:
    WHEN 'ZVAR_LYCW'.
    IF I_STEP = 2.
    CLEAR LOC_VAR_RANGE,L_S_RANGE,
    v_loc_date,
    v_loc_date1.
    * BREAK-POINT.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZVAR_CALDAY'.
    v_loc_date =  LOC_VAR_RANGE-LOW+0(4) - 1.
    v_loc_date1 = LOC_VAR_RANGE-HIGH+0(4)-1.
    L_S_RANGE-LOW = v_loc_date.
    L_S_RANGE-HIGH = v_loc_date1.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    endif.
    Edited by: JAIGUPTA on Jan 20, 2012 6:14 PM

Maybe you are looking for

  • I can no longer access the iTunes store, I get a message saying I need to update iTunes but cannot as I am on Mac OSX 10.4.1

    I have an account with the iTunes store but can no longer access the store because I get a message in iTunes store window telling me to update to an iTunes version that will only run on Mac OS 10.5.  I am on Mac OSX 10.4.1 and do not plan on upgradin

  • Coherence filters

    Hi, I am facing few problem with coherence filters . My code looks like,      ValueExtractor extractor = new ReflectionExtractor("getMethod");           Set<Map.Entry<String, ValueObject>> entries = cache.entrySet(new LikeFilter(extractor, datakey+"%

  • R12 GL Drilldown to PO

    Hello, I am looking for a query to drilldown information from GL to PO in release 12, does anyone has one? I am looking to drilldown to Purchase Orders and the Purchase Orders Receipts from GL. Thanks

  • HT201303 I lost my itouch and bought a new one and keep getting an iTunes billing error

    I lost my itouch and bought a new one and keep getting an iTunes billing error. Do I have create a new acct and loss and lose all my downloads/purchases?

  • Photoshop Elements price

    English version: Hay there! My Problem is, I'm 15 Years old, but i haven't got a ID for... Can I buy the student version without a ID? To verification you can see my first- and last name, at my school homepage ( http://www.seknauen.ch/ ). Is that eno