Sums up the last 4 weeks from the start date

Hi all,
Pls tell me how to find the give issue with example
How to write queri in SQL
sums up the last 4 weeks from the start date selected (meaning range of date 1st to 7th) (the 4 weeks should stop on the 31st).
Thanks & Regards

<DIV><FONT size=2>
<P><FONT size=2>select</FONT></FONT> tstdate, weeks, (sum*<FONT
color=#0000f0>7</FONT>) as sum<BR>from <SPAN
class=224524108-18042006>  </SPAN>(select to_date(<FONT
color=#0000f0>'&date'</FONT>,<FONT color=#0000f0>'dd-mon-rrrr'</FONT>) as
tstdate,<BR><SPAN
class=224524108-18042006>                    
</SPAN>last_day(to_date(<FONT color=#0000f0>'&date'</FONT>,<FONT
color=#0000f0>'dd-mon-rrrr'</FONT>)) as weeks, <BR><SPAN
class=224524108-18042006>                    
</SPAN>floor((last_day(to_date(<FONT color=#0000f0>'&date'</FONT>,<FONT
color=#0000f0>'dd-mon-rrrr'</FONT>)) - to_date(<FONT
color=#0000f0>'&date'</FONT>,<FONT color=#0000f0>'dd-mon-rrrr'</FONT>))
/<FONT color=#0000f0>7</FONT>) as sum <BR><SPAN
class=224524108-18042006>          
</SPAN>from dual)<FONT size=2></P></FONT></DIV>

Similar Messages

  • I've recently received 3 emails over the last 2 weeks from admin@appleid-apple.co.uk asking me to confirm my apple id- I presume this is fake

    I have recently received 3 emails over the last 2 weeks from [email protected] I presume these are fake. Can anyone confirm

    https://appleid.apple.com
    Go to the above website, sign in to your AppleID using the "Manage your Apple ID" link, and make sure everything is correct.  If it is, then clearly, at the least, the emails are in error.

  • How do I change the start date for the week from Monday to Sunday on my iPhone 5?

    How do I change the start date for the week on iCal from Monday to Sunday on my iPhone5?

    Yes. On my new iPhone 5 the iCal week begins on a Monday not a Sunday and does not give me the option to edit in settings on the phone

  • How can I get the start date and end date of a certain week?

    Hello, in my java code, I can get the week ID , using
    org.joda.time.base.AbstractDateTime.getWeekOfWeekyear() , for example, this week is the 16th week of this year. And I want to get the start date(date of Monday) and end date(date of Sunday) of the week. Is there any method can supply such date value??thanks

    1 public Date getCurrentMonday(){
    2 Date monday = null;
    3 Calendar rightNow = Calendar.getInstance();
    4 int day = rightNow.get(Calendar.DAY_OF_WEEK);
    5 int distance = 0;
    6
    7
    8 if (day == Calendar.MONDAY)
    9 monday = rightNow.getTime();
    10 else
    11 {
    12 distance = day - Calendar.MONDAY;
    13 if (distance == -1)
    14 distance = 6;
    15
    16 monday = (Date) (rightNow.getTime());
    17 monday.setTime(monday.getTime() - 1000 *60 *60 *24 *(distance));
    18 }
    19 return monday;
    20 }

  • Line Graph repeats the starting data point at the end also

    Hi,
    We have a Line Graph as below. This graph is used to show the Salary changes of a person, over time.
    But this graph shows an additional non existing data point. Basically it shows the starting data point once again at the end of the other data points.
    The model VO for this graph, does not contain this additional data point record. But the graph repeats the starting data point at the end also.
    In the screen-shot you can see that, the graph has three data points. But the table has only two. The first data point in the graph is repeated as the last data point.
    Is this a Bug..?
    Or an issue with the usage of the DVT tags?
    The code is given below.
    Please advice.
    12 <dvt:graph id="lineGraph1" value="#{bindings.SalaryHistory.graphModel}"
    13 graphType="LINE_VERT_ABS"
    14 shortDesc="#{HcmEmploymentTopGenBundle}"
    15 markerDisplayed="true"
    16 continuousTimeAxisInterval="CTAI_DAY"
    17 contentDelivery="immediate" animationOnDisplay="AUTO"
    18 imageFormat="FLASH" stylePath="April"
    19 timeSelectorListener="#{backingBeanScope.AssignmentChangesAndSalaryBean.changeTime}"
    20 timeAxisType="TAT_MIXED_FREQUENCY" dynamicResize="DYNAMIC_SIZE"
    21 inlineStyle="height:40em;"
    22 binding="#{backingBeanScope.AssignmentChangesAndSalaryBean.asgSalaryGraph}">
    23 <dvt:background>
    24 <dvt:specialEffects/>
    25 </dvt:background>
    26 <dvt:graphPlotArea/>
    27 <dvt:seriesSet>
    28 <dvt:series/>
    29 </dvt:seriesSet>
    30
    31 <dvt:o1Axis scrolling="asNeeded"/>
    32 <dvt:y1Axis/>
    33 <!-- <dvt:legendArea automaticPlacement="AP_NEVER" rendered="false"/>-->
    34 <!-- <dvt:timeSelector mode="EXPLICIT"
    35 explicitStart="#{backingBeanScope.AssignmentChangesAndSalaryBean.timeSelectorStartDate}"
    36 explicitEnd="#{backingBeanScope.AssignmentChangesAndSalaryBean.timeSelectorEndDate}"
    37 id="ts34">
    38 <dvt:specialEffects>
    39 <dvt:gradientStopStyle/>
    40 </dvt:specialEffects>
    41 </dvt:timeSelector>-->
    42 <dvt:o1MajorTick/>
    43 <dvt:o1TickLabel/>
    44 <dvt:o1Title id="o1Title1">
    45 <dvt:graphFont id="graphFont1"/>
    46 </dvt:o1Title>
    47
    48 <dvt:attributeFormat id="af1" name="DateFrom">
    49 <af:convertDateTime pattern="#{applCorePrefs.dateFormatPattern}" />
    50 </dvt:attributeFormat>
    51
    52 <dvt:markerText>
    53 <dvt:y1Format>
    54 <af:convertNumber pattern="#{applCorePrefs.numberFormatPattern}"/>
    55 </dvt:y1Format>
    56 </dvt:markerText>
    57
    58
    59 </dvt:graph>

    If I understand your question, this from the Pages online help may give the answer:
    To mark line, area, and scatter charts with data point symbols:
    Select the entire chart. You can also select the chart series (the line or area shape) that you want to mark with data point symbols.
    Click Inspector in the toolbar, and then click the Chart Inspector button.
    Click Series (except for scatter charts).
    Choose a symbol from the Data Point Symbol pop-up menu.
    Choose one of the following options from the Symbol Fill pop-up menu:
    To fill the symbol with the same color as its outline, choose Use Stroke Color.
    To fill the symbol with a solid color, choose Color Fill, click the Fill color well, and pick a color.
    To fill the symbol with a gradient, choose Gradient Fill and use the gradient controls to set the colors and change the angle of the gradient.
    To fill the symbol with an image, choose Image Fill and select the image you want. You can also resize the image by choosing an option from the pop-up menu above the Choose button.
    To fill the symbol with a tinted image, choose Tinted Image Fill and select the image you want. Click the color well to the right of the Choose button to change the tint color. You can also resize the image by choosing an option from the pop-up menu above the Choose button.

  • "The end date can't be set to occur before the start date" issue

    I have a subscribed calendar that draws from data in a Filemaker database. In all of these records, the start date & end date are the same. When I try to refresh the description, it fails with a "NSCocoaErrorDomain / error 1560" error, and the console log shows "The end date can't be set to occur before the start date."
    Well, it doesn't occur before the start date. It's the same as the start date. I can work around this by setting my Filemaker database to add a day to the end date, but that's a clunky solution.
    Anyone else run into anything like this?
    (iCal 4.0.3 and OS X 10.6.4, btw)

    It may not be the same problem, but the message was the same (end date...etc). I tore my hair out at the time trying to solve it. It was on my fathers computer. Everything appeared to be correct and consistent. What solved it was logging into MobileMe/account/personal info/time zone, where I found the time zone was wrong. I can't remember the detail now but at the time it seemed like a third place where time had to be correct. Worth your checking there anyway.

  • Same station resource with same schedule squence but the start date is diff

    We are running ASCP capacity planning but found "Same station resource with same schedule squence but the start date is different". Does anyone know which parameters/setup may impact on this result or the root causes?
    Regards,
    Edward

    Wesley,
    I am a little confused about your scenario.  I will assume that you are talking about the Planned orders that are generating the dependent requirements that are being seen by your Raw Material.
    So, you have a material (not the Raw Material) that has the Material master settings that you mentioned above.  This material has been planned, and MRP created two planned orders.  These two planned orders have the same start date, but  the dependent requirements dates that have been generated against your Raw Material are different. You do not want this to happen.  Please confirm.
    Dependent requirements of planned orders can be influenced by:
    1.  Dependent Rqments Settings in OPU5
    2.  Distribution Strategy OPB3/OPB4/OPB5
    3.  Lead Time offsets in the BOM
    Ensure that these settings meet your business requirements.
    Best Regards,
    DB49

  • Org Management - How can I change the start date of all the org units

    How can I change the start date of all the org unit objects and its relationships at one shot ?  I have created some 100 Org units with the wrong start date. Please suggest.
    Thanks in advance..
    Cheers
    Vijay

    Hello Archana,
    Thanks a lot... This has solved my issue...
    Cheers
    Vijay

  • How to maintain history in infotype 2 in ECC6 if the start date is DOB defa

    Hi,
    I have to change the status of some female employees as they are now married and their surname is aslo changed.
    But in ECC6 in infotype 2 the default start date is date of birth,  Copy option is not working as the start date will change which is the Date of Birth by default , if i directly change it history wont be maintain.
    How to go for this ?
    Regards

    Hi,
    The default start date as DOB willl be for first record.
    You can chage the data by specifying validity dates. it wont be any problem.
    Regards,
    Shankar.

  • Infotype 0002 defaults birthdate as the start date

    When we hire an applicant using transaction PBA7, the start date PA0002-BEGDA defaults to the birthdate of the applicant. We would like this field to default to the hire date. Is there a place in the config that we can make a change to to reflect this?

    You can handle it via USER_EXIT or dynamic actions "T588Z"
    Good luck !
    ^Saquib
    FYI
    Transaction Code - PA30                     Maintain HR Master Data                                                                               
    Exit Name           Description                                                                               
    HRPBAS01            User Exit for HR Master Data                                                           
    HRPC0001            HR: PC download authorization                                                          
    HRRPAI01            User exit for FB HR_ENTRY_DATE and HR_LEAVING_DATE                                     
    PARA0001            Enhancement for Determining the Number of Periods                                      
    PARA0002            Enhancement for Calculating Annual Salary; IT0008,14,15                                
    PBAS0001            PA: Pers.Admin./Recruitment: Default values and checks                                 
    PBAS0002            PA: Enhancements for Personnel Administration - Menu                                   
    PBASRP01            PA: User exit distributed reporting                                                                               
    No of Exits:          8
    http://help.sap.com/saphelp_45b/helpdata/en/7e/5e03e94a1611d1894c0000e829fbbd/content.htm

  • The end date entered occurs before the start date

    Error when setting outlook2010 OK =>
    "The end date entered occurs before the start date "
    BleuOisou

    Hi,
    Just like <Dinae> said above, this behavior occurs because Outlook does not allow you to define a calendar work day that spans midnight.
    As a supplement, please refer to this KB article:
    http://support.microsoft.com/kb/196804/en-us
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Is it poosible to control the start date for an assort idoc on the erp sise

    is it poosible to control the start date for an assortment list  idoc on the erp sise

    Hi rodeofive,
    As per my understanding, the issue is a performance issue. And it is caused by there are thousands of values in the drop-down list of parameters in the report.
    To work around this issue, I suggest you should make some changes in the report. For example, we can add additional two parameters with multiple keywords ahead, one for the dropdown contains 95k options, another for dropdown contains 24k options. Then all
    of available values which are begin with the keywords will display in the parameter list. In this scenario, we can create cascading parameters. One is a keyword parameter, and the other parameter is the drop-down list that based on the keyword to display the
    available values.
    For more details about the method, please refer to the following FAQ:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8de6c783-9cb4-4b95-9be8-b59bc0049866/forum-faqhow-do-i-add-a-search-feature-in-the-parameter-with-long-drop-down-list?forum=sqlreportingservices#8de6c783-9cb4-4b95-9be8-b59bc0049866
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • In plant parameters how the start date in past will be applicable for order

    Hi All,
    Can any one explain me in detail start in past for plant parmeters (OPPQ).
    Regards
    sailendra

    Hi,
    Start date of order proposals allowed in the past
    This indicator defines that the system does not automatically switch to forward scheduling if the order start date lies in the past for determining the basic dates. With this indicator, backward scheduling is always used to determine the basic dates, even if the start date lies in the past.
    e.g Bacward scheduling type, Today date is 08.06.2009
    If u give basic finish date say 25.06.2009,and system propose you basic start date in 06.06.2009. That is 06.06.2009 is lies in past date.In this case system propose you forward scheduling.Means order basic start date is 08.06.2009 .If you don't want to system propose you for forward scheduling tick mark Start in past in OPPQ.
    Hope this clear you.
    Regards,
    Raja.

  • Position 1000001 not available for the start date of the infotype record

    Dear Experts/Gurus,
    I am getting the following error message "Position 1000001 not available for the start date of the infotype record" while trying to upload employees HR Master data in PA40.
    I know the reason why because the position is created on 01.05.2009 & employee DOJ is 01.02.2006 both are mismatch & the position date has to be changed earlier date than DOJ but i don't know how to do.
    Please let me know how to sort out this issue asap.
    Rgds,
    Vikrant

    Dear Friend,
    Use  PP02, select the position no, select infotype 1000 (Object), select planning status & validity(date) and then use the copy function to change the start date.
    Regards,
    Aks

  • Get weeks based on start date

    Hi ,
    i need a query that will determine the weeks based on start date.
    if the table consists of:
    vDate vAmount
    06/25/2007 100
    06/27/2007 200
    07/04/2007 400
    If one enters start date as 6/25/2007 , amounts should be broken out in 7 day increments.
    Result should be
    week1 300
    week2 400
    where week1 should be from 6/25/2007 to 07/01/2007,
    week2 should be from 07/02/2007 to 07/08/2007
    and start date is not always on a Monday or Sunday...
    any idea?
    thanks in advance

    try this...
    SQL> with rt as
      2  (select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
      3  (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12)),
      4  xx as
      5  (select '06/25/2007' vdate, 100 vamount from dual union all
      6  select '06/27/2007', 200 from dual union all
      7  select '07/04/2007', 400  from dual)
      8  select wk_no,sum(vamount) from
      9  (select (select wk_no from rt where dt = to_date(vdate,'MM/DD/YYYY')) wk_no,vamount from xx)
    10  group by wk_no;
    WK_NO                                        SUM(VAMOUNT)
    week1                                                 300
    week2                                                 400
    SQL>
    SQL> select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
      2  (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12);
    WK_NO                                        DT          Day
    week1                                        25-Jun-2007 Monday
    week1                                        26-Jun-2007 Tuesday
    week1                                        27-Jun-2007 Wednesday
    week1                                        28-Jun-2007 Thursday
    week1                                        29-Jun-2007 Friday
    week1                                        30-Jun-2007 Saturday
    week1                                        01-Jul-2007 Sunday
    week2                                        02-Jul-2007 Monday
    week2                                        03-Jul-2007 Tuesday
    week2                                        04-Jul-2007 Wednesday
    week2                                        05-Jul-2007 Thursday
    .

Maybe you are looking for

  • RAW Files and Photoshop Elements 8

    Hello I have Elements 8 and want to use RAW so I downloaded and updated the plug in for RAW6.2 but still no joy. The only difference is that my file is located in C:/Program Files (x86)/Common Files/Adobe/Plug- Ins/Elements 8/File Formats. Does the P

  • Pl/Sql numeric or value error

    Hi All, Does any one know if there is a bug in Oracle 8 related to date variable? This is the second time I am seeing very peculiar problem with date package variable as well as local variable. 1) Few weeks back, I encountered problem with Date packa

  • Forefront for exchange 2010 - how long?

    Hi there. Read this article: http://blogs.technet.com/b/server-cloud/archive/2012/09/12/important-changes-to-forefront-product-roadmaps.aspx I would have additional question. Our company is MS Gold Partner and we need to renew our yearly license ever

  • Can you stream from BBCi Player using Apple TV?

    Hi All, Looking into getting the apple TV for my dad but want to know if it will actually come in handy so please tell me ... Can you stream from BBCi Player/ITV Player from laptop to TV via the Apple TV? Many Thanks

  • Problem importing raw files from camera

    Hello I am new to digital photography and am having trouble importing raw files from my panasonic lumix g1 into elements 7.  I can import them into the software that came with the camera, but I would rather use photoshop.  Can anybody advise me on th