Query returns data from previous month. Need to have it return data for the entire year

This is the part of the query that returns data by month:
(YEAR(`rereport`.`market_reports_5`.start_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)AND MONTH(`rereport`.`market_reports_5`.start_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH))
How can I get it to return data for the year.
TIY

How about omitting the MONTH part:
(YEAR(`rereport`.`market_reports_5`.start_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
Regards, Hans Vogelaar (http://www.eileenslounge.com)

Similar Messages

  • TS4036 I added Icloud to join my calendar to another person. It erased all history date from previous months. how do I get that data back?

    I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?

    i found the answer to the first part: reboot and keep hold of command+r
    this gave me a list of options
    one of them was to reinstall lion from fresh
    i went for this
    dont know why... but all forum posts i read said u should delete hard disc? theres an option for this
    which is the right option?
    any suggesstion where i go to register new mac would be great
    thanks

  • HT201238 If we upgrade to a new monthly plan do we get a refund for the full year plan that we've already purchased?

    If we upgrade to a new monthly plan do we get a refund for the full year plan that we've already purchased?

    You will need to contact Apple - we are all other end users like you here.
    iCloud storage pricing - Apple Support

  • Help needed on balance sheet plan report for the current year

    Hi BW gurus,
    I have a problem with reporting.
    I need to get  Balance-Sheet Plan Reports for the Planned year and for the current year.
    To get the report for the planned year its  straight forward just by restricting 0balance by the version to 1 and the valuetype 20.
    But I have a problem with the current year report.
    I have fiscal year and the company code as the variables.
    The report should be like this.
    If we need the report as of today(July 26 2006),we may input 2006 for the fiscal year variable.
    And the 0balance for the twelve fiscal periods should be as follows
    From jan 2006 to june 2006(fiscal periods) it should have only the actuals
    From july 2006 to dec 2006(fiscal periods) it should have  only  the plan
    I have already built a query by having two restricted keyfigures on 0balance.
    One by restricting version and valuetype 0 and 10 , and the other with 1 and 20.
    But in the report I am getting two columns of data for each fiscal period for 12 periods.0balance with actuals and 0balance with plan.
    But I need to get 0balance with actuals from jan to june(individually for each fiscal period columnwise),and 0balance with plan from july to dec(individually for each fiscal period columnwise).
    Hope you people can visualize my report.
    Please help me ASAP.
    Any kind of help is appreciated.
    My mail id is [email protected]
    Thanks in advance
    Regards
    Sam Mathew

    Hi Sam,
        Did u get this issue solved. I am having the same issue now. Can u please let me know if u have a solution for this.
    Thanks
    Prasad

  • Help find the Last run date from previous month

    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMP
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMK

    Welcome to the forum!
    user2931503 wrote:
    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMPThat's a very bad idea. Points in time should always be stored in DATE (or maybe TIMESTAMP) columns. If not, you're going to waste resources converting them to DATEs whenever you need them to behave like DATEs, and risk run-time errors because of bad data.
    Normally, the "previous" month means the month before the current month. In April, the previous month is March.
    By "previous" month, do you mean the 2nd latest month in the table? That is, this data contains data from February and March, 2011; March 2011 is the latest of those months, February 2011 is the next-to-last, and so is that why you want a date from February?
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMKTry this:
    WITH   got_real_date   AS
         SELECT     TO_DATE ( SUBSTR (date_ran, 1, 14)
                   , 'MM/DD/RR-HH24:MI'
                   )     AS real_date
         FROM     table_x
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT     TO_CHAR ( MAX (real_date)
              , 'MM/DD/RR-HH24:MI'
              )     AS last_date
    FROM    got_month_num
    WHERE     real_date     < (
                               SELECT  TRUNC (MAX (real_date), 'MONTH')
                         FROM    got_real_date
    ;Edited by: Frank Kulash on Apr 5, 2011 3:59 PM

  • HT3275 I've 1.85TB empty space on my time Machine, but it only backs up to the beginning of the previous month. it should have weekly back-ups for every month before that. Any ideas why it deletes stuff older than a month?

    I've 1.85TB empty space on my Time Machine, but it only retains back-ups to the beginning of the previous month. I should be able to access weekly back-ups for every month before that until the disk is full. Any ideas why it deletes stuff older than a month?
    Thanks, Rigby.

    If you are using Ethernet to connect your Mac to the Time Capsule, are you allowing at least 2-3 minutes for Time Machine to fully load when you open the application to see your backups?
    If you are using wireless to connect, you may need to allow 8-10 minutes or longer for everything to fully load, depending on the speed of your wireless connection.
    If you see only white time "bars" on the timeline at the right of the screen, you are seeing temporary backups. Permanent backups are displayed with purple "bars".

  • Hi, I recently purchased an IPad Air.  I have a Dell PC that has the Verizon.  Security Suite.  Do I need to have virus/malware protection for the IPad Air?  Thanks.

    Hi, I recently purchased an IPad air.  Do I need to place virus protection software for it?  I also have a Dell PC that has the Verizon Security Suite.  Thanks for your info.  Jim

    You do not need anti virus for the iPad. The ipad only installs things from the App Store and those apps are vetted. In addition, the operating system of the ipad isn't the same as PC's or Macs so common viruses don't run on them.
    The only thing you need to be aware of is protecting your info....Go to a bad site and enter your info and you're just as vulnerable as you would be on a computer. So the device isn't vulnerable to anything but user actions.

  • Need to calculate interest paid/earned for the coming year ...

    All,
    Working up the 2010 budget, and decided to give Numbers a whirl vs. continuing with M$ Excel for another year. One of the things I do is make some kind of educated estimate on how much my interest I will pay on each of my loans in the following year.
    Example - auto loan:
    Balance: $10,000
    Interest rate: 7%
    Payment: $200/month
    You get the idea. Does Numbers have a formula that will calc the effective interest I would have paid by December 2010, recalculating the new principal and interest each month as the balance goes down, etc? I looked at IPMT, but some of the variables don't seem to make sense to me.
    Appreciate the help in advance.
    Bones

    Ok, that works for some things. (Thanks again).
    If you have a fixed-term loan (auto, home, etc.) then CUMIPMT seems to work great. But in the case of revolving credit lines, credit cards, where there is no fixed term the formula breaks down.
    For example:
    CreditCardX
    - APR: 10%
    - Balance: $5,000
    - Projected payment/month: $150
    CreditCardY
    - APR: 12%
    - Balance: $4,000
    - Projected payment/month: $125
    In the coming 12 months, I want to play with the numbers to see how much interest I will pay on X versus Y over the coming year ... up the payment on X and see how that changes things versus upping the payment on Y ... you get the idea.
    I guess I can just create a manual formula (?)
    Still appreciate any help as I am figuring out Numbers.
    Bones

  • Needs to have a specific table for the F4 functionality

    Hi Gurus,
    I have created a parameter which uses the F4 functionality.
    I have used
    PARAMETER: P_PARAM like T001-BUKRS.
    What I need is the F4 should call a custom table and not the default search help that is being called.
    Thanks in advance.
    Benedict

    Hi,
    Use the below code
    DATA: BEGIN OF it_bukrs OCCURS 0,
            bukrs LIKE t001k-bukrs,
          END OF it_bukrs.
    SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS:    p_bukrs(4) TYPE c.
    SELECTION-SCREEN END OF BLOCK main.
    Validation Section
    INITIALIZATION.
      SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BUKRS'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_BUKRS'
          value_org       = 'S'
        TABLES
          value_tab       = it_bukrs
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

  • Wagetypes /561(Claim) and /563(Claim from Previous month

    Hi,
    Please explain the wagetypes /561(Claim) and /563(Claim from Previous month). and thier relevance.
    I know that the difference between /561 and /563 shows the net amount that SAP has reclaimed from the overpayment in a single month.
    What in case these wagetypes occur in case of a LEAVER? Then how this should be dealt with.

    Hi Srijit,
    Thanks for replying.
    My case is of an employee who left the company in June08. His last payroll was run in June.
    Now when the salary of february was processed it came to notice that  Rs388/- was posted into employee suspense account. His salary statement shows Take Home pay as Zero.
    The posting shows the following:
    /552 ( stat net adj)  ( amount)388.00 (credit)
    /561 (claim) (amount)50,390.00 ( debit)
    /563(claim from prev month) (amount) 50,002.00( credit)
    This is the scenario.
    Edited by: dips on Feb 27, 2009 7:32 AM
    Edited by: dips on Feb 27, 2009 7:33 AM
    Edited by: dips on Feb 27, 2009 7:36 AM

  • Data being removed from previous months calendars.

    My
    Data is being removed from previous months calendars

    Go to settings>mail,contacts, and calendars. Make sure the settings for Sync under calendars is set to all events to sync all past events.

  • What authorities do I need to start a dispute with for Verizon charging for "Unbilled Data From Prior Months - GB "

    For the second month in a row, Verizon has added a $15.00 "data over usage" fee.  When I call customer service, I am told that the charge is for over usage of data from prior months in which they can't tell me what months we went over.  We've been Verizon customers for 10+ years & all of a sudden their customer service has severely declined.  I am always on Verizon's website looking at our usage and the past 6 month analysis to make sure we're staying within our range of usage and we've never gone over our allowed plan for data.  I plan to file a formal complaint/dispute with all of the consumer protection agencies and/or authorities but need to know which ones are for telecommunications issues for Georgia consumers.

    For a customer of 10 years to never read the customer agreement...:
    "HOW AND WHEN CAN I DISPUTE CHARGES?
    If you're a Postpay customer, you can dispute your bill within 180 days of receiving it, but unless otherwise provided by law or unless you're disputing charges because your wireless device was lost or stolen, you still have to pay all charges until the dispute is resolved. If you're a Prepaid customer, you can dispute a charge within 180 days of the date the disputed charge was incurred. YOU MAY CALL US TO DISPUTE CHARGES ON YOUR BILL OR ANY SERVICE(S) FOR WHICH YOU WERE BILLED, BUT IF YOU WISH TO PRESERVE YOUR RIGHT TO BRING AN ARBITRATION OR SMALL CLAIMS CASE REGARDING SUCH DISPUTE, YOU MUST WRITE TO US AT THE CUSTOMER SERVICE ADDRESS ON YOUR BILL, OR SEND US A COMPLETED NOTICE OF DISPUTE FORM (AVAILABLE AT VERIZONWIRELESS.COM), WITHIN THE 180–DAY PERIOD MENTIONED ABOVE. IF YOU DO NOT NOTIFY US IN WRITING OF SUCH DISPUTE WITHIN THE 180-DAY PERIOD, YOU WILL HAVE WAIVED YOUR RIGHT TO DISPUTE THE BILL OR SUCH SERVICE(S) AND TO BRING AN ARBITRATION OR SMALL CLAIMS CASE REGARDING ANY SUCH DISPUTE."
    SEE FULL AGGREEMENT HERE: Customer Agreement | Verizon Wireless

  • Formula to subtract current month from previous month

    Hi
    I would like to how to subtract current month from previous month in Crystal 10.  Basically am looking at the variations that between the two month .   I would also like to know the 12 m onth rolling data formula.  Using the same formula, you need to get the difference between the two month.
    Any help on this is very much appreciated.
    Thanks
    Regards
    Cauvery

    Hi Thanks for reponding.
    Though the formula is correct, I don't think it will work out in that way because I have a 12 months rolling data  formula and using this formula  I have to subtract the current month from previous month.
    This the formula that am currently using for 12 months rolling data
    {HPD_HelpDesk.Arrival Time} >= DATEADD ("yyyy", -1, CURRENTDATE)
    Please advise.
    Regards
    Cauvery

  • My Tomcat server always shows data from previous run !!

    Hi
    I have html form whose method is post and submit data to jsp .The JSP then process the input data , produce some images and place them in appropriate directory and uses <img src=.. > to show them in the browser. But I am always getting the images from previous run . If I refresh , then I get the right images. Its so annoying. Since I am the developer, I know that I am not getting the right image. But other users might think that my program has bugs.Well it might be a bug . Is there anything I can do in my application to prevent this? Pls help/suggest me. I am new to web Application.
    Advance thanks!

    I'm not saying to change the image file name... all I'm saying is write the image tag's source URL with a unique query string parameter (such as the current time).
    If the image files are different names each time, there's not going to be any caching, so it shouldn't be a problem. If the image files are the same name each time (the image generator overwrites whatever is there already) then this is where the caching becomes a problem for the browser. So you don't need to do anything except what I already said, add ?x=timestamp to the image file name in the image source attribute. This doesn't change the image file name, it will still get the same image. It'll only prevent the browser from going to a cached image when the next time it loads, cuz the URL will be different.
    As for Scottie's comments... the reason is so that the browser doesn't have to load the image from the server every time. It's generally expected that most content on the web is not changing, unless the server includes headers with the file that specify when the file expires. For most servers, you have to set up special general rules about setting expiration times (x hours/days/etc.) for it to use based on file type. With JSP, you can manipulate the headers in the JSP page, but this just applies to the page, not the images or other content in the page, which are separate browser requests.

  • Want to show data from current month & prev month in single record on forms?

    Hello experts,
    i have this requirement:
    Table structure:
    MOnth       Division         totalAmount
    01-apr-2013      1               10000
    01-May-2013    1               20000
    01-apr-2013      2               30000
    01-May-2013    2               50000
    i want to display in forms like
    Form:
    Month  : 01-May-2013
    Month               Division               total               prev_Month          division               total                         dIFFERENCE
    01-May-2013               1              10000                01-Apr-2013               1               20000                        10000
    01-May-2013               2              30000                01-Apr-2013               2               50000                        20000
    I am using two procedure for fetching records for current month and previous month.
    but it will cause problem, if for some division previous month data not present.
    please suggest me some query with which i can fetch current and pre month data in single record.
    Please help me out.
    Thanks
    yash

    I'M NOT SURE BUT TRY IT ............
    select x.mn mnth, x.division, x.totalAmount total, y.mn prev_month,  y.division, y.totalAmount total, (y.totalAmount - nvl(y.totalAmount,0)) difference
    from
      (select month mn, division, totalAmount
      from table_name
      where month = (select max(month)
      from table_name
      ) x,
      (select month mn, division, totalAmount
      from table_name
      where month = (select add_months(max(month),-1)
      from table_name
      ) y
    where x.division = y.division(+)
    MOSTAFIZ MITUL
    DHAKA BANGLADESH

Maybe you are looking for