How to compare this week with last years week sales ?

Hi all,
I have a table called Sales with two columns  Date and UnitsSold
Date is of type smalldatetime   and will have the date of the sales
while UnitsSold is type int and will have the number of units sold
I need to write a stored procedure that will compare between a week's sales from last year with a week sales from this year and show the percent in sales difference
Thanks

DECLARE @thisYearThisWeekStart DATETIME = DATEADD(DAY,1-DATEPART(weekday,'2014-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE())-1,'2014-01-01'))
DECLARE @thisYearThisWeekEnd DATETIME = DATEADD(DAY,0-DATEPART(weekday,'2014-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE()),'2014-01-01'))
DECLARE @lastYearThisWeekStart DATETIME = DATEADD(DAY,1-DATEPART(weekday,'2013-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE())-1,'2013-01-01'))
DECLARE @lastYearThisWeekEnd DATETIME = DATEADD(DAY,0-DATEPART(weekday,'2013-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE()),'2013-01-01'))
DECLARE @thisYear INT, @lastYear Int
DECLARE @salesTable TABLE (date DATE, unitsSold INT)
INSERT INTO @salesTable (date, unitsSold)
VALUES
('2013-07-07',10),('2013-07-08',9),('2013-07-09',8),('2013-07-10',7),('2013-07-11',6),('2013-07-12',5),('2014-07-13',4),
('2014-07-06',12),('2014-07-07',13),('2014-07-08',14),('2014-07-09',15),('2014-07-10',16),('2014-07-11',17),('2014-07-12',18)
SET @thisYear = (SELECT SUM(unitsSold) AS tUnitsSold FROM @salesTable WHERE date BETWEEN @thisYearThisWeekStart AND @thisYearThisWeekEnd)
SET @lastYear = (SELECT SUM(unitsSold) AS tUnitsSold FROM @salesTable WHERE date BETWEEN @lastYearThisWeekStart AND @lastYearThisWeekEnd)
SELECT @thisYear AS thisYear, @lastYear AS lastYear, CONVERT(float,ROUND(((@thisYear+.0)/@lastYear)*100,2))
You should really use a calendar table.

Similar Messages

  • Which Time variable should use compare this month with last month

    We want to calculate the increaed number of employees according to one action reason e.g. Entry to company compare with last month. In this case we have to use time variable in BEx query designer. Now can see 0calmonth has serval variable available.
    1) Should we use [0CMLMON] for last month and use offset for this month like [0CMLMON]-1 or [0CMLMON]+1 or use variable [0RSTTCM1], which variable should we use for this month and last month? Do we need to create variables by manually?
    2) Then using calculated KF to calculate the increaed number of employees, is this logic correct? If it is wrong, please info.
    Edited by: hi ni on Apr 22, 2008 7:58 AM

    Hi,
    For the comparison of last 2 months data, you can use two Restricted Key figures with reference to 0CALMONTH and it is better to use only customer exit variable for both RKF's.For the Last month use offset value as -1.
    Rgs,
    I.R.K

  • My iPod touch 3rd gen. 32gb doesn't allow me to access my "Saved Photos" because the "Albums" banner covers it. This occurred with last week's update.

    My iPod 3rd gen 32gb won't allow me to see my "Saved Photos" because the "Albums" banner covers it. This occurred with last week's update.

    I've read that the only cure is opening the Multitaskbar by double clicking the home button, search for the photo app, tap on it until it starts to shake and hit the little "Minus-icon" in the left corner. Then close the bar again and try again to open the photo app.

  • How to make this work with Firefox, HELP!

    Downloading for Real-player, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. How to make this work with Firefox, I like not to use Microsoft products, and I really like Firefox 7.0.1!!!! HELP!

    -> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
    * Advanced panel -> Network tab
    * place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
    * Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
    * click OK on Options window
    * Restart Firefox
    Check and tell if ts working.

  • How to set this filters with 'or' relationship

    Hi Pros,
          I have a query as follows, rows and columns are all in structures.
                                                       regular_employees
                 active_employees
                 lay_off_employees
         I want to set up filter as ' employ_status = 0 or employ_subgroup =2' for this query, please tell me how to set this filters with 'or' relationship.

    Hi Yifei,
    Create a formula and enter this (let's name this FORMULA_KF):
    ((EMPLOY_STATUS = 0) OR (EMPLOY_SUBGROUP = 2)) * enter value IF_TRUE + enter value IF_FALSE
    Then create the condition to HIDE the rows having those values to be filtered (if this is your purpose)..
    Like,
    FORMULA_KF <> 1
    Is this what you want mate?
    Regards,
    Loed

  • Can anybody tell how to compare two documents with two pointers controlled with the same mouse

    can anybody tell how to compare two documents with two pointers controlled with the same mouse ??

    I saw what I need but in a game to find the differences between two photos (two screens, two pointers controlled by one mouse), and I need a program to make the same thing   (compare a chosen files)

  • How to replce the ename with last name & first name in this program

    Hi all,
    The below include program is with the reference of std report CATSSHOW.
    in which ename is the field to fetch the employee name, but now we want the emloyee name like last name & first name i.e in two separte column.
    how i implement this change in this include program.
    ENAME IS Define like that
    ename LIKE pernr_list_structure-ename,
    If u whant to refer the report put u can execute the std repot CATSSHOW.
    Pls help on this.
    Send me the code.
    pls find the include prgram ZHNO_INCLUDE_CATSDATA from where they declare the ename.
    4.6B
    QWKP99K050532 13081999 note 167550
    4.6A
    XQIALRK154280 19.11.98 key date on selection screen
    4.0C
    YIKALRK098973     30.03.1998  F4 Hilfe für Objektid
      INCLUDE CATSDATA                                                   *
    db-tabellen
    TABLES:
      prps,
        catsdb,
        catsdb_ext.
    Remarked by LuX 11 Dec. 1998
       crhd.                                                 "YIK
    dd-structuren
    TABLES:
        gdstr,
        gdset,
        catsd,                             "dialogstruktur
        sscrfields,
        t77mt,                             "modulübergreifende texte
        objec.
    Remarked by LuX 19981210 - CATS decoupling (seems not used)
      rcr01.
    "arbeitsplatz aus sicht pläne
    Added by Jerlece on 04/04/2002 - SIR 2836
    TABLES:
        pa0001,           "HR Master Record: Infotype 0001 (Org. Assignment)
         hrp1000.          "Infotype DB table : 1000
    *End of addition
    type-pool enthält feldkatalogstruktur
    TYPE-POOLS:
        kkblo.
    konstanten
    CONSTANTS:
      DATENULL20          TYPE D             VALUE ' ',      QWKP99K050532
        datenull20          TYPE d             VALUE '        ',
        datenull30          TYPE d             VALUE '00000000',
        no                  TYPE c             VALUE 'N',
        off                 TYPE c             VALUE '0',
        yes                 TYPE c             VALUE 'Y'.
    Added by Jerlece on 10/04/2002 - SIR 2836
    DATA: BEGIN OF i_objid OCCURS 0,
             objid(100),
           END OF i_objid.
    End of addition
    DATA:
        gt_sp_groups TYPE kkblo_t_sp_group WITH HEADER LINE.
    DATA for REFRESH of PCHSOBID
    DATA : old_otype LIKE wplog-otype VALUE 'O'.
    DATA: BEGIN OF i77eo_key,
             mandt LIKE t77eo-mandt,
             otype LIKE t77eo-otype,
           END   OF i77eo_key.
    DATA: BEGIN OF i77eo OCCURS 2.
             INCLUDE STRUCTURE t77eo.
    DATA: END OF   i77eo.
    DATA: BEGIN OF i778l OCCURS 5.
          INCLUDE STRUCTURE T778L.
    DATA:   langu LIKE t778l-langu.
    DATA: END OF   i778l.
    DATA   allowed_pernr_index       LIKE sy-tabix.
    DATA    flag_save                 TYPE c.
    DATA:  selcheck_save_struk_index LIKE sy-tabix.
    felder
    DATA:
        flag           TYPE c,             "Drucktastenbelegung
        saveflag       TYPE c,
        saveflag_esa   TYPE c,
        f_stich        TYPE c VALUE yes,   "1. X sichtag
        daynumber      TYPE c,             "Wochentagnummer 1-7
        pchobjid_count TYPE i,
        i778l_count    TYPE i,
        i77eo_count    TYPE i,
        txtid          LIKE t77mt-txtid,   "Wochentagtext
        exist_werk     TYPE c,             "werk eingegeben
        week           LIKE scal-week,     "Wochen zum Tag
        no_selection   TYPE c.             "YIKALRK167448
    DATA: BEGIN OF icatsdb OCCURS 0.
             INCLUDE STRUCTURE catsdb.
           include structure cats_exten.
    *data: checkbox(1) type c,
         lights(1)   type c,
    DATA:  END OF icatsdb.
    DATA: BEGIN OF selcheck OCCURS 0,
             fielname  LIKE dbindfld-field,
             flag(1)       TYPE c,
           END OF selcheck.
    DATA: BEGIN OF selcheck_save_struk OCCURS 0,
           FIELNAME(10)  TYPE C,                               NOTE 167550
             fielname      LIKE dbindfld-field,                 "note 167550
             flag(1)       TYPE c,
           END OF selcheck_save_struk.
    DATA: BEGIN OF selcheck_save OCCURS 0,
           FIELNAME(10)  TYPE C,                               NOTE 167550
             fielname      LIKE dbindfld-field,                 "note 167550
           END OF selcheck_save.
    DATA : BEGIN OF maco_objects OCCURS 5,
              plvar LIKE plog-plvar,
              otype LIKE plog-otype,
              objid LIKE plog-objid,
            END   OF maco_objects.
    RANGES so_datum_save FOR catsdb-workdate.
    INCLUDE .
    datendeklarationen für CATSSTRC                                     *
    TYPE-POOLS: kkblo, capp.
    TYPES: tabix LIKE sy-tabix OCCURS 0.
    TYPES: BEGIN OF icatsdb_lst_type.
             INCLUDE STRUCTURE catsdb.
    TYPES:   checkbox(1) TYPE c,
              lights(1) TYPE c,
              ename LIKE pernr_list_structure-ename,
           END   OF icatsdb_lst_type.
    TYPES: icatsdb_lst_type_table TYPE icatsdb_lst_type OCCURS 0.
    TYPES: BEGIN OF allowed_pernr_type,
             pernr LIKE catsdb-pernr,
             ename LIKE pernr_list_structure-ename,
             begda LIKE catsdb-workdate,
             endda LIKE catsdb-workdate,
           END   OF allowed_pernr_type.
    TYPES: allowed_pernr_table TYPE allowed_pernr_type OCCURS 0.
    DATA: allowed_pernr TYPE allowed_pernr_table WITH HEADER LINE.
    DATA: yx TYPE c VALUE 'X'.
    DATA: is_variant LIKE disvariant.
    DATA: es_variant LIKE disvariant.
    DATA: fcode(4).
    DATA: subrc LIKE sy-subrc.
    DATA: approve TYPE c.
    rhx-f4-objid-data.                    "YIKALRK098973
    INCLUDE rhodat00.
    Added by Lu Xiaozhou for CATS decoupling 10 Dec. 1998
    DATA: sys_type LIKE tcesyst-devtype.
    DATA: posid TYPE ps_posid.
    *added by anand on 8/21/02 TD 1480 ========>D20K908220
    *ranges for date to build & then put in selection criteria
    RANGES r_datum FOR sy-datum.
    *end of addition on 8/21/02 TD 1480=======>D20K908220
    *added by anand on 9/10/02 TD 1513 =======> D20K908525
    *New internal table to get the begin & end date also with ENum
    DATA: BEGIN OF it_pers OCCURS 0,
            pernr LIKE pa0001-pernr,
            begda LIKE pa0001-begda,
            endda LIKE pa0001-endda,
           END OF it_pers.
    *end of addition on 9/10/02 TD 1513 ======>D20K908525
    begin of anc01
    DATA: BEGIN OF i_pernr OCCURS 0,
           pernr LIKE pa0003-pernr,
           END OF i_pernr.
    DATA: BEGIN OF i_persa OCCURS 0,
           persa LIKE t500p-persa,
           END OF i_persa,
           BEGIN OF i_persk OCCURS 0,
           persk LIKE t503k-persk,
           END OF i_persk.
    DATA: BEGIN OF i_orgeh OCCURS 0,
           orgeh LIKE t527x-orgeh,
           END OF i_orgeh.
    DATA: BEGIN OF i_pa0105 OCCURS 0,
           pernr LIKE pa0105-pernr,
           usrid LIKE pa0105-usrid,
           END OF i_pa0105.
    end of anc01
    begin of TD 4107 Anand
    store sub org units
    DATA: BEGIN OF i_sobid OCCURS 0,
           sobid LIKE hrp1001-sobid,
           END OF i_sobid.
    store user entered org units
    RANGES: r_orgeh FOR pa0001-orgeh.
    end of TD 4107 Anand
    *Added by Ketan Joglekar, SIR6599 05/08/2006  D20K921585
    DATA: ws_mandt LIKE sy-mandt. "#EC NEEDED
    *Added by Ketan Joglekar, SIR6599 05/31/2006  D20K921851
    DATA: BEGIN OF wa_catsco_temp,
           counter LIKE catsco-counter,
           belnr LIKE catsco-belnr,
           trans_no LIKE catsco-belnr,
           docnr LIKE catsco-belnr,
           END OF wa_catsco_temp.
    *End of changes Ketan Joglekar, SIR6599 05/31/2006  D20K921851
    DATA: BEGIN OF i_cobk OCCURS 0,
          counter LIKE catsco-counter,
          docnr LIKE catsco-belnr,
          budat LIKE cobk-budat,
          END OF i_cobk.
    DATA: ws_week LIKE scal-week.
    *End of Changes.
    -> D10K919801
    DATA: w_aut_zhr15  type c,
           w_aut_zhr17  type c.
    -> D10K919801

    Completely support!
    I yesterday switched from I-mate PDA2K and got over 200 contacts from Outlook to my 6820 in format of first name space father name space second name. Terrible!
    My phone fails to search by the last name - search is useless in fact. And last names are almost invisible because of long first and father names in Russian.
    It's a nightmare. Could anybody help please? How to sync with Outlook to have last name first???
    Best Regards,
    Vladimir.

  • How to design for YTD, Monthly & Last year Key figures

    Hi Gurus:
    Can you pls tell me how to design a data model, where a user wants to get YTD, Monthly & Last year Key figures say Sales volume...
    Is aggregates the answer?
    Pls let me know...Thanks a lot

    Hi Vijay,
    I am a beginner in BI field.
    I have a problem till now i couldnt get the right answer.
    That the reason why i write you today.
    My Problem is with a Query.
    I'm designed a dynamic query which should look like this:
    12.2005-- Jan06 --- Feb06 --- Mar06 --- Apr06 ... Dec06 --- YTD
    My Problem, if you give per e.g Dezember, all Months have to appear. Or you give may, your going to receive till may.The result i receive till now its only the month i gave.How can i get the correct answer? How i am going to calculate the YTD?
    You can directly answer hier:[email protected]
    Thanks

  • How to compare a date with current date

    I have 3 drop menus for a user to choose day, month and year. After the user submit the form, my system should be able to detect whether the date chosen has passed compared to TODAY's day. I thought I could compare the day, month and year as integers, but it sounds quite tedious with this integer combination. I wonder if there is any methods available to compare dates. I come to know that I can use something like Calendar.before(). Could anyone give me some idea?

    I'm little confused with your suggestion since I'm new in Java and JSP. I hope you could give me some more hints. Anyway, I got this thing but couldn't really apply it:
    public boolean before(Date when)
    Tests if this date is before the specified date.
    Parameters:
    when - a date.
    Returns:
    true if this date is before the argument date; false otherwise.

  • How to build this query with the minumum number of sub-selects?

    The question I am trying to answer is analogous to this:
    Give me all projects that: (have no employees assigned and are small) or (have only employees with the the last name = "Smith")
    Thanks,
    Roman

    Thank you :
    1- I am in 9.0.4.8 version and can not use allOf expression (availible in beta version)
    2- I not find .notIn(subQuery) operator in 9.0.4.8 version and i replace it by .in(subQuery).not() !
    My new query retrieve Customer who have 0 (zéro) Orders !
    How to retrieve only customer (with orders + with orders without "television") ?
    My new query is :
    <div align="left" class="java">
    <font color="#7f0055"><b>static </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">findCustNoComputer </font><font color="#000000">(){</font>
    <font color="#ffffff">   </font><font color="#000000">ClientSession cs = TopLinkSession.acquireClientSession</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff"></font>
    <font color="#ffffff">  </font><font color="#000000">ReadAllQuery query = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReadAllQuery</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">ExpressionBuilder queryBuilder = query.getExpressionBuilder</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff">  </font><font color="#000000">ExpressionBuilder subqueryBuilder = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ExpressionBuilder</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">ReportQuery subQuery = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReportQuery</font><font color="#000000">(</font><font color="#000000">Customer.class, subqueryBuilder</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">subQuery.addAttribute</font><font color="#000000">(</font><font color="#2a00ff">&#34;id&#34;</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">subQuery.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">subqueryBuilder.anyOf</font><font color="#000000">(</font><font color="#2a00ff">&#34;Orders&#34;</font><font color="#000000">)</font><font color="#000000">.anyOf</font><font color="#000000">(</font><font color="#2a00ff">&#34;OrderItems&#34;</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;product&#34;</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;productName&#34;</font><font color="#000000">)</font><font color="#000000">.equal</font><font color="#000000">(</font><font color="#2a00ff">&#34;Computer&#34;</font><font color="#000000">))</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">query.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">queryBuilder.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;id&#34;</font><font color="#000000">)</font><font color="#000000">.in</font><font color="#000000">(</font><font color="#000000">subQuery</font><font color="#000000">)</font><font color="#000000">.not</font><font color="#000000">())</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff">   </font><font color="#000000">Vector allCustomers = </font><font color="#000000">(</font><font color="#000000">Vector</font><font color="#000000">)</font><font color="#000000">cs.executeQuery</font><font color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#000000">Iterator allCustomersIterator = allCustomers.iterator</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#7f0055"><b>while </b></font><font color="#000000">(</font><font color="#000000">allCustomersIterator.hasNext</font><font color="#000000">()) </font>
    <font color="#ffffff">   </font><font color="#000000">{</font>
    <font color="#ffffff">     </font><font color="#000000">Customer tempCustomer = </font><font color="#000000">(</font><font color="#000000">Customer</font><font color="#000000">)</font><font color="#000000">allCustomersIterator.next</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff">        </font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#000000">tempCustomer</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#000000">}</font>
    <font color="#ffffff">   </font><font color="#000000">cs.release</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#000000">}</font>
    <font color="#ffffff"></font>
    <font color="#ffffff"></font>
    Sql of query :
    SELECT
         t0.CUST_LAST_NAME, t0.CUST_FIRST_NAME, t0.CREDIT_LIMIT, t0.CUST_EMAIL, t0.CUSTOMER_ID, t0.PHONE_NUMBER2, t0.PHONE_NUMBER1, t0.CUST_STREET_ADDRESS1, t0.CUST_CITY, t0.CUST_STREET_ADDRESS2, t0.CUST_STATE, t0.CUST_POSTAL_CODE
    FROM TL_CUSTOMER t0
    WHERE NOT (
         (t0.CUSTOMER_ID IN
              (SELECT DISTINCT t1.CUSTOMER_ID
              FROM TL_CUSTOMER_ORDER t4, TL_ORDER_ITEM t3, TL_PRODUCT t2, TL_CUSTOMER t1
              WHERE (
                   (t2.PRODUCT_NAME = ?) AND
                   ((t2.PRODUCT_ID = t3.PRODUCT_ID) AND
                        ((t3.ORDER_ID = t4.ORDER_ID) AND (t4.CUSTOMER_ID = t1.CUSTOMER_ID)))))))
    Regards

  • Calculating this month of last year revenue

    Hi,
    i am preparing a new dashboard like below
    month total revenue total revenue of last year (january - 2011)
    january 125.00 120.00
    can you please share your experience how can i do this?

    Hi,
    If you always want to show the previous years data (ie not only last year, but last two/three/.. years) then you can use AGO function in
    RPD.
    Refer for AGO-
    http://gerardnico.com/wiki/dat/obiee/ago
    OR,
    But if you are using for a single last year then in the column formula use - 'January'||cast(year(current_date)-1 as char)
    (If its always January you want)
    Hope this helped/ answered.
    Regards
    MuRam
    Edited by: MuRam on Jun 12, 2012 5:08 AM

  • How to compare single value with multiple values

    In my query I have something like this:
    A.SOR_CD=B.SOR_CODE where A and B are 2 different tables. This condition is in the where clause. The column in table A has single values but some values in table B have multiple comma separated values (822, 869, 811, ..).  I want to match this single
    value on the left side with each of the comma separated values. Please let me know how will I be able to do it. The number of comma separated values on the right side may vary.

    Hi MadRad123,
    According to your description, you want to compare single value with multiple values in your query. Right?
    In this scenario, the table B has comma separated values, however those comma separated values are concatenated into a string. So we can use charindex() function to return the index of the table A value. And use this index as condition in
    your where clause. See the sample below:
    CREATE TABLE #temp1(
    ID nvarchar(50),
    Name nvarchar(50))
    INSERT INTO #temp1 VALUES
    ('1','A'),
    ('2','A'),
    ('3','A'),
    ('4','A'),
    ('5','A')
    CREATE TABLE #temp2(
    ID nvarchar(50),
    Name nvarchar(50))
    INSERT INTO #temp2 VALUES
    ('1','a,A'),
    ('2','A,B'),
    ('3','c'),
    ('4','A,C'),
    ('5','d')
    select * from #temp1 a inner join #temp2 b on a.ID=b.ID
    where CHARINDEX(a.Name,b.Name)>0
    The result looks like below:
    Reference:
    CHARINDEX (Transact-SQL)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How long will this MacBook Pro last me?

    I recently have received a mid-2009 macbook pro as a gift. I have upgraded the software to Mountain Lion (and most likely going to upgrade to Mavericks whenever it comes out). I am going to become a high school senior in the upcoming months. I was wondering how long this laptop would last me! I like gaming, but the graphics aren't that good even on low quality, but I'm sure this laptop will be fine for my last year of high school and til the end of college prehaps?
    Thanks,
    Christopher!
    Edit:
    I understand there isn't just a breakdown date or timer, but I am just asking for a guess from the community! Sorry for the confusion if there was any.
    Thank you!

    Your machine is about 4 years old and in it's end of life stage for a laptop.
    It al depends how much abuse the previous owner did to it, how much wear on the keyboard/Superdrive and on the graphics etc.
    I'd say another year or two and it's done.
    The reason gaming is bad it's because they are designed for PC towers and the latest graphics which a laptop you can't upgrade.
    Also the many OS X operating system versions also has a part as later OS X versions slow down older machines.
    If you want to 3D game, then get a PS4 or a Windows 7/8 3D gaming tower and upgrade the video card every couple of years to a better one.
    That's the only way, Mac's can't upgrade the video card anymore and new 3D games need better graphics.
    The only way one can keep a Mac a very long time is to take exceeding great care of it, all the wear and tear on external devices, then there is a limit to upgrading operating systems and Apple will begin denying security updates as well.
    Good luck

  • How to compare current date with past date

    Sample code for comparing current date with past date
    i dont want to Calender.set method to compare it.
    How can i do it?

    PLEASE stay with ONE thread:
    http://forum.java.sun.com/thread.jspa?threadID=5143991&tstart=0

  • How to compare 2 arrays with different operator options using parameters in Teststand

    Pls let me know how to compare 2 arrays using different operators like <= or >= or ==......

     I am using TS 2010. FYI
    ex:
    Array XX [ A_Temp,
                   B_Temp,
                   C_Oil Pressure,
                   D_Oilpressure,
    Note : A_Temp, B_Temp,C_Oil Pressure,D_Oilpressure all these parameters will be getting  numerical values (dynamically) from the simulink models and also in future I may need to add parameters to this array.
    Array YY [A_Temp_1,
                   B_Temp_2,
                   C_Oil Pressure_3,
                   D_Oilpressure_4,
    Note : A_Temp_1, B_Temp_2,C_Oil Pressure_3,D_Oilpressure_4 all these parameters will be getting  numerical values (dynamically) from the simulink models
    So my question :
    I would like to verify A_Temp >= A_Temp_1
                                B_Temp >= B_Temp_2
                                C_Oil Pressure  >= C_Oil Pressure_3  etc

Maybe you are looking for