To get the list of working days-3 to working days+10 of every month

Hi,
I am looking for a query,which will give me the list of working days in a column (except Saturday and Sunday)ranging from
[Working day- 3] to [Working day +10]of each month from (April 2014 ) till 2016 December.Could you please help me in achiving it.
Note :Working day -3 means ,When the first working day of a month is [ 1st April ,Monday].
So it has to result as March 27,28 and 29 as my last working days.
Same logic applies for Working day +10(it needs to give total 10 dates,which excludes Saturday and Sunday)
Regards,
Ramesh

DECLARE @monthDate datetime
SET @MonthDate = '20140401'
SELECT [Date]
FROM
SELECT [Date],ROW_NUMBER() OVER (PARTITION BY DATEDIFF(mm,0,[Date]) ORDER BY [Date]) AS Seq,
ROW_NUMBER() OVER (PARTITION BY DATEDIFF(mm,0,[Date]) ORDER BY [Date] DESC) AS BSeq
FROM dbo.CalendarTable(DATEADD(dd,- 10,@MonthDate),DATEADD(yy,2,@MonthDate),1,0)
)t
WHERE (Seq BETWEEN 2 AND 11 AND [DATE] > @MonthDate)
OR BSeq BETWEEN 1 AND 3
ORDER BY [Date]
CalendarTable can be found here
http://visakhm.blogspot.in/2010/02/generating-calendar-table.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Since upgrading to Firefox 5.0, the screen freezes & have to force quit in order to get the browser to work. This happens every time I try to use it.

    Every time I open Firefox, within several minutes, the screen freezes, and the only way I can make it work is to force quit.
    This works for awhile, and then I go through the whole thing
    again.

    c uses the same profile folder as the Windows and Linux platform.
    You can locate the Firefox Profile Folder via
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    Copy and Paste this code in the Code field in the <i>"Tools > Error Console"</i> and click the <i>Evaluate</i> button to see the location of the profile folder.
    <pre><nowiki>alert(Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path);
    </nowiki></pre>

  • How get the actual hours worked by the employee in SAP.

    Hello Experts,
    How to get the actual hours worked by employee in a month.( Any infotypes or tables or fm)
    I have report to get planned hours of the employee
    Thanks and Regards
    Reddy

    Hello expert,
    I am a technical guy, I dont have functional knowledge and HR functional support is not available at the moment..
    I have requriement to develop a report to caluclate the actual night shift hours worked by the employee...
    I have report : RPTEDT00 where in I have actual hours worked day and night..
    But I am not able to find how do in my custom program from the program reference...So I want to know is there any way where in I see this data in tables or infotypes
    Thanks and Regards
    Reddy

  • How to get the list of top 10 tables grown last week or last few days

    Hi All,
    Please let me know, how to get the list of top 10 tables grown last week or last few days
    Thanks

    Please let me know, how to get the list of top 10 tables grown last week or last few days1.Oracle Version and OS info please ... ALWAYS
    2.Do you have licensing options (Tuning and/or Diagnostics Pack) ?
    3.Have you ran AWR/Statspack in last week or last few days
    1.Because Oracle do not store auto tack the history of tables growth. See below link where one user has showed the possible way of manual track of table(s) growth :
    Re: oracle tables growth
    2.MOS Note for How To Get Table Growth History Information? [ID 1395195.1]
    3.If you are in 10g than EM of 10g has something called Segmnet Statistics which can show you the growth of your table.
    4.Other clue :
    SQL> select * from table (dbms_space.object_growth_trend('SCOTT','EMP','TABLE'));
    TIMEPOINT                                                                   SPACE_USAGE SPACE_ALLOC QUALITY
    17-SEP-12 11.06.20.228000 AM                                                       1593       65536 GOOD5.A good script by Mice Ault for historical growth of segments within AWR:
    http://www.dba-oracle.com/t_table_growth_reports.htm
    Regards
    Girish Sharma

  • Can we get the list of all BO report scheduled to be sent(or have been sent) for a specified day?

    Hi all,
    For all BO reports scheduled to be sent out, can we get the list of all BO report to be sent(or have been sent) for a specified day?(For example, today or nex Monday).    Thank you.
    Regards,
    Eton.

    Hi Eton,
    To check the instances which have ran today, you can use the below query in query builder.
    SELECT SI_NAME,SI_ID FROM CI_INFOOBJECTS WHERE SI_INSTANCE=1 AND  SI_STARTTIME > '2014.08.20 00:00:00' Order by SI_STARTTIME DESC
    To check the instances which would be running in the future, that means you have recurring schedules. Check for the SI_NEXTRUNTIME to get the details of instances which will run in the future as per the recurrences.
    Thanks,
    Prithvi

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to get the list of IDM users in a workflow.

    Hi,
    I wanted to get the list of IDM users in a workflow into a list.Now I tried to use getObjects Method,I do not have the display session here,I passed the workflow context or WF_Context.But it is giving exception like context null .
    I used the same method in a form and it worked.How can I get the list of users in a workflow.It is for customizing reports.
    Thanks and Regards,
    Pandu
    Any Idea on how to customize reports including attributes from resources and auditing attributes etc.Any help would be really great.
    Thank you.

    Hi John,
    I get this exception WorkItemForm: no id.
    This comes when I click on the other column.I generate the data needed in a report and display it as a sorting table when I get the data.
    I want to give the user ability to sort data by different columns.But when I click any column I get the exception
    WorkItemForm: no id
    How can I save a workitem on a manual form before invoking it from a manual action.
    Here is the code snippet
    <Field name='tblUsers'>
            <Display class='SortingTable'>
              <Property name='selectEnable' value='false'/>
              <Property name='align' value='left'/>
              <Property name='linkEnable' value='false'/>
              <Property name='sortEnable' value='true'/>
              <Property name='width' value='400'/>
              <Property name='columns'>
                <List>
                  <String>Account id</String>
                  <String>First Name</String>                      
                </List>
              </Property>
            </Display>      
            <FieldLoop for='row' in='_searchList[*]'>
              <Field name='enduserId'>
                <Display class='Label'>
                  <Property name='value'>
                    <block trace='true'>
                      <invoke name='getAccountId'>
                        <ref>row</ref>
                      </invoke>
                    </block>
                  </Property>
                </Display>
              </Field>
              <Field name='lblfirstname'>
                <Display class='Label'>
                  <Property name='value'>
                    <invoke name='getAttribute'>
                      <ref>row</ref>
                      <s>firstname</s>
                    </invoke>
                  </Property>
                </Display>
              </Field>
         <FieldLoop>      I think I may need to save some workItem,That is why this may be giving the error.How can I correct this.
    Thanks,
    pandu

  • To Get the list of sales orders for a Business partner in CRM.

    Hi all
    Is there any Function module or BAPI to get the Sales orders for a Business partner in CRM. I know there is a BAPI to get the list of sales orders for a customer in ECC, but I donu2019t know how to get the list of sales orders for a Business Partner in CRM.
    Can anybody tell me if there is an inbuilt function module or BAPI available?
    If not how can I pick the sales orders of a business partner in CRM? Between which tables should I apply a join and write SELECT statement to get list of sales orders for a business partner in CRM.

    Hi Jessica,
    Try CRM function module CRM_BUPA_READ_ORDER_OBJECTS.
    You'll get a table with the documents associated to that partner, where you can work on.
    Kind regards.

  • Compaq Presario R3000 how to get the sound to work with Windows 7 RC

    1) Download     SP29586.exe: ftp://ftp.hp.com/pub/softpaq/sp29501-30000/sp29586.exe
    2) Run it, Create a directory  c:\ swsetup 
    3) Once all the Files are extracted DO NOT INSTALL
    4) Now Goto the Start Menu  Click on Devices and Printers, the Click on the Name you have called your  machine this will be marked will a yellow triangle as the sound driver windows 7 has install already is a realtek ac 97 which is not working, 
    5) Once your Machinename  you will see a general tab and and hardware tab select the hardware tab.
    6) Look for the Realtek ac 97  under the Device functions, select that and click properties,
    7) Now tab to the Driver, now click update driver,
    8) Select the option let me pick from a list of devices drivers, now click have disk
    9) Click on Browse  select the following location Swsetup\SP29586\SMAXWDM\W2K_XP and click on  smwdmCH6.inf 
    10)Now the Soundmax Driver should come up select ok and  next. Now your Sound will work
    This question was solved.
    View Solution.

    I am basicaly having the same problem with my labtop. I tried the following above and yet I still have not been able to get my sound to work. I have had some problems with my power and sound cards before but after I reinstalled windows my graphics card and sound card have not been working to their full potential. I thaught that it was a 64 bit graphics card, but now I am not so sure. I had to jostle the power cord in the back till I mannaged to find a perfect spot to keep the computer running. Before the reinstallation I had to put pressure on the left side of the computer to get the sound to work.. but even then it still came in and out.. "The sound that is." I can see the same driver in the codex menue and it is yellow but, what you stated above did not work.
    It says (Cannot continue the hardware update) The wizard cannot find a better match for your hardware than the software that you curently have installed. and then tells me to keep the current software. My sound Icon does not show up when I go to the settings.... I can't play diablo 2 on this no idea why... But my screen is choppy when I scroll through internet sites and it did not do that before. I have a 400mbs connection .... here is my computer information. :Compaq Presario R3000 Intel pent4  2.80ghz    2.80ghz       1.12GB ram and im running on windows xp2 professional.

  • If I wish to print Contacts as a list how do I get the list to be alphabetized.  All my contacts print but they are not in alpha order.

    Sign out

    If I wish to print Contacts as a list how do I get the list to be alphabetized.  All my contacts print but they are not in alpha order.-cannot find an answer other than use iCloud which did not work.Tried Safari and Firefox.
    What to try?

  • Satellite C660-18C - Can't get the microphone to work

    So I couldnt get the microphone to work so I bought a new one. I also can not get this to work. I have tried everyway I can think of and it simply will not register any sound and yes the microphone is on and the volume is full.
    Can someone please help me fix this? Its driving me crazy!

    Hi belthazora,
    Just to make sure we talk about an external microphone that you have connected to microphone jack and not internal one? I ask this because the notebook doesnt have internal microphone.
    Anyway, if you use an external microphone make sure its listed in sound devices under recording tab. Can you see it there?
    I would also recommend a sound driver update if it doesnt work. You can download all updates on official Toshiba page:
    http://eu.computers.toshiba-europe.com > Support & Downloads > Download Drivers

  • How to get the list of application instance assigned to user

    Hi,
    I need to run the query in BI publisher to get the list of all the application instance assigned to a user in OIM 11g R2.
    Please let me know how to get this data. Also please let me know what is the table to see the list of application instance in OIM.
    Thanks

    Got this working..
    The table is APP_Instance to get the details of Application Instance present in OIM.

  • How to get the list of documents

    Hi everyone
    Can anyone help me How to get the list of documents residing in a folder of KM repository of SAP Netweaver using a simple java program
    Thanks in ADV.
    Rupesh Khemka

    Hi Rupesh,
    I have written the code for you and it works with WebDynpro, no seperate java program is required.
    Just try to paste it in your application code and run it.
    try{
         // Will check the user athentication for EP
                    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
         IUser sapUser = wdClientUser.getSAPUser(); 
         com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
         ResourceContext context = new ResourceContext(ep5User);
                    // The path in which your folder resides
         RID rid1 =RID.getRID("/documents/Public Documents/SCAP/");
         IResourceFactory factory1 = ResourceFactory.getInstance();
         ICollection icollection = (ICollection)factory1.getResource(rid1, context);
         IResourceList resourcelist = icollection.getChildren();
         int size1 = resourcelist.size();
         for(int s=0; s<listOfDocuments.getLength(); s++){
              IResource resource = resourcelist.get(i);
              InputStream input = new InputStream();
              input = resource.getContent().getInputStream();
    }catch(Exception e){
         e.getMessage();
    Once you get the InputStream everything else is possible....
    This will surely help you in reading the documents from KM.
    Regards,
    Rekha Malavathu

  • How to get the list of unviewed Instances?

    Hi All,
    Can anyone tell me how to get the list of unviewed instances?
    I want to get all the instances which have been scheduled but not viewed.
    Please help me on this.
    I tried to get the info from audit report but i could not able to achieve it.
    is it possible from query builder?
    Thanks,
    Nagaveni

    Hi Ravi,
    Thank you for the reply!!
    Then it is not possible to get the unviewed reports.
    how does it work if i create a audit report with Viewed status and list of all instances then we can filter out the unviewed reports.
    Does above solution is going to work?
    i have not tried yet, seeking your opinion.

  • How to get the list of object that are going to modify during the upgrade?

    We are upgrading sap 4.OB to ECC 6, is there any place we will get the list of standard object which are going to modify in service market place? Please let me know the link to get those details.
    Thanks

    Usually you get this list when upgrading first system (sandbox type) via SPDD and SPAU. (useful for objects modified in your system - SNOTE or mofications) - The whole list of modified objects will be huge,  many (most) objects were modified (created, even deleted) those last 13 years.
    There are also tools that may help you like [panaya|http://www.panayainc.com/] (but i'm not sure for a 4.0B, it worked fine for a 46c) - look for tools/vendor at [Partner Information Center: Search|http://www.sap.com/partners/directories/SearchSolution.epx]
    Regards,
    Raymond

Maybe you are looking for

  • Error occured: NWDS cannot be launched

    I shut down my Neweaver Developer Studio, and restart this morning, and I got the following error. I reinstall the studio from the installation file, it still give me the same error. The NWDS platform get launched and encountered errors and shut down

  • Mac won't sleep after adding Kensington Wireless Mouse

    I've added a Kensington PilotMouse Laser Wireless to my system and now it won't sleep, without first switching off the mouse. Kensington has no info on this, is there a workaround? PowerMac G4 (Dual 867) Mac OS X (10.4.4)

  • Setting deletion indicator/Flag for an operation in production order

    Dear All, Hi                  How to set deletion indicator/flag for an operation in a production order. I don't want to delete the operation as such. Please help & suggest. Ragards, Shaiz

  • Touchscreen and keyboard problems

    I am having several issues with the touchscreen. I have to swipe several times on the lock screen and my bottom four buttons (safari,mail, phone, messages) are not responding when I press them. The screen actually scrolls when I press them. Also, my

  • Sugestions for Director 12

    (hope someone in Adobe reads that) Before its too late 1 Make life easier for tlash users who want to make some 3d, add to Director only ONE more languages: ActionScript2 ( AS3 sux ) 2 game lybraries game lybraries game lybraries 3 a better IDE, dont