How to select Months with in a date range

Hi
I am working on a report which will list out Month wise totals in each row.
How should i select the Months with in a date range and do the sum ( User may select the date range for  N number of  years also. Example :  01/10/2000 to 01/01/2010 )
Thanks in advance
Thanks&regards
Mrudula

Hi
   Use the following code:
data: l_date(8) value '03042007',
        l_mname   type   t247-ktx,
        l_c(25).
  select single ktx from t247
  into l_mname
  where spras = sy-langu
  and mnr = l_date+2(2).
  concatenate l_mname l_date+6(2)
  into l_c." SEPARATED BY space.
  data: g_date(10) type c. " Processing date of Report
  g_date = sy-datum.
  concatenate g_date0(4)  g_date4(2)  g_date+6(2) into g_date.
  data: g_date1(10) type c.
  g_date1 = so_verab-high.
  concatenate g_date10(4)  g_date14(2)  g_date1+6(2) into g_date1.
Regards,
Sreeram

Similar Messages

  • How to select textFrames with tracking different to 0 (zero)?

    How to select textFrames with tracking different to zero (greater or smaller than zero)?
    Thanks.

    Hi All,
    Thanks for your help. The orignal clips are from Sony PMW F3 camera and I have got Dimensions: 1920 × 1080, Codecs: MPEG-2 Video, Linear PCM, Timecode, Color profile: HD (1-1-1), Total bit rate: 36,623.
    The other camera has given me .MTS files which I have converted in MPEG-2 also. I used Wondershare Video Converter to convert second cameras clip.
    I don't think the clips are matching with first camera's clips because still that is saying the same thing.
    Regards,
    Jai

  • How get Mailbox Folder Item Count for date range?

    How to make query to Exchange 2013 like this:
    query ItemCount (specified Mailbox, specified Folder (with subfolders), specified Date Range)?
    I find this script for Exchange 2010: http://gsexdev.blogspot.ru/2012/10/item-age-sample-one-reporting-on-item.html
    This script dont work for Exchange 2013 ((

    I believe you are making the change on both the places in code, as this path version would be different in 2013
    C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"
    Cheers,
    Gulab Prasad
    Technology Consultant
    Blog:
    http://www.exchangeranger.com    Twitter:
      LinkedIn:
       Check out CodeTwo’s tools for Exchange admins
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Select records with in a given range

    Hi Team,
    I've very urgent requirement. I urge please help as soon as possible
    I've two table like below
    Subscriber Table
    SID Sub_StDate Sub_Enddate
    101 05-jan-2014 28-mar-2014---SET S1
    101 01-apr-2014 29-june-2014---- S2
    101 01-Aug-2014 14-dec-2014---S3
    102 01-jan-2014 31-aug-2014---S4
    Premium Table
    SID pre_StDate pre_Enddate
    101 01-jan-2014 28-feb-2014 --- SET P1
    101 01-mar-2014 30-july-2014 --- SET p2
    101 01-jul-2014 14-oct-2014----P3
    101 15-oct-2014 31-dec-2014---P4
    102 01-jan-2014 31-aug-2014 ---P5
    i need to split subcriber table date range by comparing with premium table date range and keep them in temp table
    i.e my temble should be
    SID Stdate enddate
    101 05-jan-2014 28-feb-2014
    101 01-mar-2014 28-mar-2014
    (mt S1 falls into P1 and P2 range)
    101 01-apr-2014 29-june-2014(s2 falls in P2only)
    101 01-aug-2014 14-oct-2014
    101 15-oct-2014 31-dec-2014
    (s3 falls in p3,p4)
    102 01-jan-2014 31-aug-2014(direct)
    That means i need to check my subscriber date range falls under which premium and i need to split time range accordingly for all subscribers. and my one more constraint is I have millions of records like this. If I use more loops,performance is getting down
    very badly.
    Please give optimized solution I've very less time to give it client. Please help. let me know still need more explanation on my requirement
    thanks in advance
    sundari
    Sundari

    Hi, sqlsaga beat me by few minutes and he did good job!
    The following code also in the same lines
    SELECT S.[SID] AS 'SUBSCRIBER SID' , S.[Sub_StDate], S.[Sub_Enddate],
    P.[SID] AS 'PREMIUM SID' , P.[pre_StDate], P.[pre_Enddate],
    S.[SUBSCRIBER], P.[PREMIUM]
    INTO #TEMP1
    FROM
    SELECT S1.[SID], S1.[Sub_StDate], S1.[Sub_Enddate], S1.[SUBSCRIBER]
    FROM
    SELECT 101 AS SID, CONVERT(DATE,'01/05/2014') AS Sub_StDate , CONVERT(DATE,'03/28/2014') AS Sub_Enddate, 'S1' AS SUBSCRIBER
    UNION ALL
    SELECT 101 AS SID, CONVERT(DATE,'04/01/2014') AS Sub_StDate , CONVERT(DATE,'06/29/2014') AS Sub_Enddate, 'S2' AS SUBSCRIBER
    UNION ALL
    SELECT 101 AS SID, CONVERT(DATE,'08/01/2014') AS Sub_StDate , CONVERT(DATE,'12/14/2014') AS Sub_Enddate, 'S3' AS SUBSCRIBER
    UNION ALL
    SELECT 102 AS SID, CONVERT(DATE,'01/01/2014') AS Sub_StDate , CONVERT(DATE,'08/31/2014') AS Sub_Enddate, 'S4' AS SUBSCRIBER
    ) AS S1
    Subscriber Table
    SID Sub_StDate Sub_Enddate
    101 05-jan-2014 28-mar-2014 ---SET S1
    101 01-apr-2014 29-june-2014 ---S2
    101 01-Aug-2014 14-dec-2014 ---S3
    102 01-jan-2014 31-aug-2014 ---S4
    ) AS S ---Subscriber Table
    OUTER APPLY
    SELECT P1.[SID], P1.[pre_StDate], P1.[pre_Enddate], P1.PREMIUM
    FROM
    SELECT 101 AS SID, CONVERT(DATE,'01/01/2014') AS pre_StDate , CONVERT(DATE,'02/28/2014') AS pre_Enddate, 'P1' AS PREMIUM
    UNION ALL
    SELECT 101 AS SID, CONVERT(DATE,'03/01/2014') AS pre_StDate , CONVERT(DATE,'07/30/2014') AS pre_Enddate, 'P2' AS PREMIUM
    UNION ALL
    SELECT 101 AS SID, CONVERT(DATE,'07/01/2014') AS pre_StDate , CONVERT(DATE,'10/14/2014') AS pre_Enddate, 'P3' AS PREMIUM
    UNION ALL
    SELECT 101 AS SID, CONVERT(DATE,'10/15/2014') AS pre_StDate , CONVERT(DATE,'12/31/2014') AS pre_Enddate, 'P4' AS PREMIUM
    UNION ALL
    SELECT 102 AS SID, CONVERT(DATE,'01/01/2014') AS pre_StDate , CONVERT(DATE,'08/31/2014') AS pre_Enddate, 'P5' AS PREMIUM
    ) AS P1
    WHERE (
    ( S. [SID] = P1.[SID] )
    AND
    ( S.[Sub_StDate] BETWEEN P1.[pre_StDate] AND P1.[pre_Enddate] )
    OR
    ( S.[Sub_Enddate] BETWEEN P1.[pre_StDate] AND P1.[pre_Enddate] )
    Premium Table
    SID pre_StDate pre_Enddate
    101 01-jan-2014 28-feb-2014 ---SET P1
    101 01-mar-2014 30-july-2014 ---P2
    101 01-jul-2014 14-oct-2014 ---P3
    101 15-oct-2014 31-dec-2014 ---P4
    102 01-jan-2014 31-aug-2014 ---P5
    ) AS P ---Premium Table

  • How to process reports with two different date fields

    Morning all,
    This question is somewhat similar to what I asked few days back. I created two different reports for two different departments (Credit Control and Free of Charge Control).
    These two reports pull data from two different date fields and has different status check ups.
    Few days back my director requested me if he can have both reports in one report. That is when I asked question from all of you regarding two reports.
    Anyhow, that was created by implementing two sub reports however, the director asked me to combine the two different reports into one in such a way that the output records should be added up with each other hence one single report with all combined data of Credit Control and Free of Charges (not two sub reports in one report).
    The problem here which I am getting is that, both reports uses two different date fields. I can live with two different statuses as that can be easily done within formula/RT however how to create a report with Report Selection Formula condition which looks in both date fields and produces results accordingly?
    I have tried this by not putting any condition in report selection formula and ran the report, it produced total results from past 6 years.
    Any ideas how to produce combined report which has two different date fields?
    Many thanks in advance
    Regards
    Jehanzeb
    What I

    Charliy,
    No the both dates are from two different databases, tables and fields. The Credit date field is from KLAB database under max table where as the FOC date field is from SAE database under maxmast table. Klab date is under credit2 table where as foc date is under order header table.
    So its more like this:
    Klab->Max-Credit2--->Credit_date
    Sae->Maxmast->Order_header---Date entered.
    two dates totally different tables, dbs
    however, I will try your idea too and see if that works.
    Regards
    Jehanzeb

  • Using Labview how can one store different data in different sheets of same excel file, I mean how to select different sheets to store data??

    Hello Everyone,
    I want to store various data but in different sheets of excel file. So how to select Different sheets of same excel file???
    Thanks so much 
    Pallavi 

    aeastet wrote:
    Why do you not want to use Active X?
    One very good reason that I can think of is that MS keeps changing their ActiveX interface with each version of Excel, so code written for one version of Excel using ActiveX may not work for another version of Excel, even though the basic functionality hasn't changed. A perfect example is when MS changed the "Value" property to "Value2". Yeah, that made a whole lot of sense.
    pals wrote:
    I dont want to use active X as i am not
    getting results... by using write to spreadsheet in am getting results
    but on just one sheet... I want different data on different sheets of
    same excel file. So....
    Can anyone help me in this...
    Then it's something you're doing. Please post your code. Have you tried a search on this forum for ActiveX and Excel? There have been tons of posts on it, including lots of examples. There's also the Excel thread.

  • How does select stmt with for all entries uses Indexes

    Hello all,
    I goes through a number of documents but still confused how does select for all entries uses indexes if fields are not in sequences. i got pretty much the same results if i take like two cases on Hr tables HRP1000 and HRP1001(with for all entries based upon hrp1000). Here is the sequence of index fields on hrp1001 (MANDT, OTYPE, OBJID, PLVAR, RSIGN, RELAT, ISTAT, PRIOX, BEGDA, ENDDA, VARYF, SEQNR). in second case objid field is in sequence as in defined Index but i dont see significant increase in field even though the number of records are around 30000. My question is does it make a differrence to use field sequence (same as in table indexes) in comparison to redundant field sequence (not same as defined in table indexes), secondly how we can ge tto know if table index is used in Select for entries query i tried Explain in ST05 but its not clear if it uses any index at all in hrp1001 read.
    here is the sample code i use to get test results.
    test case 1
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
    *                    objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C' and
                        objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.
    test case 2
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
                        objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C'." and
    *                    objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.

    Mani wrote:
    Thank you for your answer, its very helpful but i am still nor sure how does parameter rsdb/max_blocking_factor affect records size.
    Hi,
    The blocking affects the size of the statement and the memory structures for returning the result.
    So if your itab has 500 rows and your blocking is 5, the very same statement will be executed 100 times.
    Nothing good or bad about this so far.
    Assume, your average result for an inlist 5 statement is 25 records with an average size of 109 bytes.
    You average result size will be 2725 byte plus overhead which will nearly perfectly fit into two 1500 byte ethernet frames.
    Nothing to do in this case.
    Assume your average result for an inlist 5 statement is 7 records with an average size of 67 bytes.
    You average result size will be ~ 470 byte plus overhead which will only fill 1/3 of a 1500 byte ethernet frame.
    In this case, setting the blocking to 12 ... 15 will give you 66% network transfer performance gain,
    and reduces the number of calls to the DB by 50%, giving additional benefit.
    Now this is an extreme example. The longer the average row length is, the lower will be the average loss in the network.
    You have the same effects in memory structures, but on that layer you are fighting single micro seconds instead of
    hundreds of these, so in real life it is rarely measurable.
    Depending on table-statistics, oracle might decide for short inlists to use a concatanation instead of an inlist.
    This is supposed to be more costy, but I never had a case where I could proove a big difference.
    Values from 5 to 15 for blocking seem to be ok for me. If you have special statements in customer coding,
    it #might# be benefitial to do the mentioned calculations and do some network tracing to see if you can squeeze your
    network efficiency by tuning the blocking.
    If you have jumbo frames enabled, it might be worth to be analyzed as well.
    If you are only on a DB-CI system that is loopback connected to the DB, I doubt there might be a big outcome.
    Hope this helps
    Volker

  • How to export schema with it's data

    db11gxe , apex 4.0 , firefox 24 ,
    hi all,
    i want to export my database tables with it's data included ?
    thanks

    Hi,
    I do not see how question relates to APEX.
    Maybe you check Oracle XE documentation
    http://docs.oracle.com/cd/E17781_01/server.112/e18804/impexp.htm#CFHJAHAA
    Regards,
    Jari

  • How to display record with most recent date in sapui5?

    Hi
    I have a local json data with me, in which I have number of records.
    And in each record I have an "AENDATE" as a date property.
    Now I want to display the record with most recent date in the records.
    How I can I do it......????????
    Please help me with this.
    Thanks
    Sathish

    How about sorting your json model descending, and display only first (index:0) item?

  • How to select paths with the same stroke width

    I would like to know how to select all the paths inside a document whose stroke width are equal to 0.361 points
    I will appreciate any help.

    here you go
    #target illustrator
    // script.name = selectPathsThisSize.jsx;
    // script.description = selects pathItems that have the same supplied stroke width; limited to 3 decimals;
    // script.required = a document with at least one path item;
    // script.parent = CarlosCanto // 6/5/11;
    // script.elegant = false;
    var idoc = app.activeDocument;
    var strokewidth = prompt ("Enter Stroke Width in points of paths to be selected", 0.361, "Select Paths this size:___");
    for (i=0 ; i< idoc.pathItems.length; i++)
              var ipath = idoc.pathItems[i];
                   if ( (ipath.strokeWidth).toFixed(3) == Number(strokewidth).toFixed(3))
                             ipath.selected = true;
    app.redraw();

  • Smart Collection: How to select files with unassigned/unknown/null metadata?

    Is there an easy way to set up a Smart Collection to show all files with unassigned/null data in a specific metadata field?
    Example: Smart Collection to show all files where IPTC "City" is unassigned (null/ blank)
    I currently have a mickey mouse way of doing it that works, by selecting files NOT containing a,b,c,d,e,f,..... in the chosen metadata field, but can't beleve a more elegant (built-in) solution doesn't exist for unassigned/null values
    thks!

    "I will release a new plugin, Any Filter, in a day or two, that, among many other things, will allow you to search for fields with no values."
    that sounds great, thanks, John!
    i know nothing about the LR internal code, but would imagine that having to check each field's text string against 36 separate conditions (a-z, 0-9) as i'm currently having to do is not nearly as efficient performance wise as just testing against a single null flag or indicator - especially in large catalogs (i have about 120,000 files in mine) 

  • Selecting last record in a date range

    Post Author: Alien8n
    CA Forum: Data Connectivity and SQL
    I need to extract the last record for a group and display it. Normally this would simply mean selecting the max date in the SQL but...I need the last record from within a specified date range. By using the max date it won't pull out any records for a group that has a record after my date range. ie I have 2 group items and they both have a record for each day of the weekBy leaving the date open it pulls out the last record, Friday, for each item in the group.I want to set a range saying give me the last record from Mon - Wed.What I want returned is Wed's records and if there's no records on Wednesday the next last record for that itemSo If I have...Item Date    RecordA     MON     1A     TUE      2A     FRI       3B     MON    4B     TUE      5B     WED    6B     THUR    7B     FRI       8I get A     TUE      2 B     WED    6FYI CR XI with SQL 2005

    Post Author: Alien8n
    CA Forum: Data Connectivity and SQL
    The database actually contains sample tests by date with each sample being tested multiple times over several months.I need to be able to pull a date range from the whole dataset, but I only want the last record in each date range. Samples can be tested every week or every 2 weeks and then the last record is used to show how the sample is doing over time. So you would run the report for say 3 weeks and show the last record for each sample. This wouldn't be a problem if you were only interested in the last 3 weeks data, but if you want to look at historical records you have to be able to pull from that date range. In effect the query has to work regardless of whether you ask for Mon-Fri (using my example above) or Mon-Wed or even just Mon alone. I'll give your example above a try and see how it goes

  • How to pull records only for particular date range in Flex frm SAP wd table

    Hi,
    Can anyone help me with databing for datefield.
    I am using two datefields in Flex for Start Date and End Date. When I click the Execute button, it should pull only the records for that date range from SAP wd table and display in my Flex datagrid.
    Thanks,
    Sri
    Edited by: rmsridevi on May 17, 2011 4:38 PM

    Hi,
    Your query has mistakes as well. I corrected them.
    Check this two different ways were in first you can define the period (month) you want and in second you have the option to select from the drop drown list :
    SELECT T0.DocNum, T0.DocDate, T0.CardName,T0.DocTotal,T1.whsCode
    FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE t0.docdate >= '2011.01.01' and t0.docdate <='2011.01.31'
    OR
    SELECT T0.DocNum,T0.DocDate,T0.CardName,T0.DocTotal,T1.whsCode
    FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE t0.docdate >= [%1] and t0.docdate <= [%2]
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • How to produce the effect of a date range inner join without actually doing one

    I have a T-SQL inner date range join that has done the job, but now that I am starting to learn about query optimization (as in just starting), I'm scratching my head on how to make it better. I see the non-equi join as being the issue because the optimizer
    scans through the entire table.  As you will see from the DDL code pasted below, there are no possible equi-joins. The enrollment history table has about 6000 rows so far, whereas the calendar table has only 10 so far, but is subject to change, which
    is why I have it as a table join.
    Another way to describe this is in the necessary outcome, which you see in the "Is_FAY" column in the Select statement. For each row in the Enrollment History table, I use the Case statement to determine whether the pair of Entry and Exit dates
    are within the Calendar date ranges (and if so, which row the match is found). There are no nulls in either table by design.
    At first, I thought of adding a non-clustered index, but the credible resources and blogs are mixed. Some sources say to use them, others say not to use them, and the remainder are on the fence. That and the
    fact that I drop and recreate the table every 24 hours (there are many updates to the Black Box) makes me very leery about having indices other than the primary key.
    I have pasted DDL language below with sample data.  Change the "Use Learning_Curve" statement to whatever database you want to use -- the rest will run as written.
    Now that I've given you some background and what I hope to accomplish, I hope that someone has encountered this issue before and can suggest an avenue of further inquiry, because I am out of usable research sources and ideas. 
    Thank you
    USE Learning_Curve;
    GO
    IF OBJECT_ID('dbo.Enrollment_History', 'U') IS NOT NULL
    DROP TABLE dbo.Enrollment_History;
    CREATE TABLE dbo.Enrollment_History
    (ID INT NOT NULL identity(1, 1) PRIMARY KEY,
    Campus_ID INT NOT NULL,
    Student_ID INT NOT NULL,
    Entry_Date DATE NOT NULL,
    Exit_Date DATE NOT NULL);
    INSERT INTO dbo.Enrollment_History
    VALUES (1, 103934, '2014-08-11', '2015-01-10'),
    (1, 102912, '2014-09-10', '2015-05-10'),
    (1, 199234, '2014-08-07', '2015-05-01');
    IF OBJECT_ID('dbo.Calendar_FAY_Dates', 'U') IS NOT NULL
    DROP TABLE dbo.Calendar_FAY_Dates;
    CREATE TABLE dbo.Calendar_FAY_Dates
    (ID INT NOT NULL identity(1, 1) PRIMARY KEY,
    FY VARCHAR(4) NOT NULL,
    Start_B DATE NOT NULL,
    Start_E DATE NOT NULL,
    End_B DATE NOT NULL,
    End_E DATE NOT NULL);
    INSERT INTO dbo.Calendar_FAY_Dates
    VALUES ('FY14', '2013-08-05', '2013-08-29', '2014-04-30', '2014-05-15'),
    ('FY15', '2014-08-07', '2014-08-28', '2015-04-30', '2015-05-15');
    SELECT eh.ID,
    eh.Campus_ID,
    eh.Student_ID,
    eh.Entry_Date,
    eh.Exit_Date,
    cfd.FY,
    case
    when eh.Entry_Date >= cfd.Start_B
    and eh.Entry_Date <= cfd.Start_E
    and eh.Exit_Date >=cfd.End_B
    and eh.Exit_Date <= cfd.End_E
    then 1 else 0 end as Is_FAY
    FROM dbo.Enrollment_History eh
    inner join dbo.Calendar_FAY_Dates cfd
    on eh.Entry_Date >= cfd.Start_B
    and eh.Exit_Date <= cfd.End_E

    This definitely a case where an indexes on the two tables will speed things up significantly. 
    It's also one of those strange cases where you can't really rely on the numbers you see in the execution plan. To really get an idea the impact to need to actually time the query...
    For example. Running your final query with out any additional indexes took ~4,000 microseconds...
    Adding the following index, dropped that time down to ~3,000 microseconds...
    CREATE NONCLUSTERED INDEX ix_Enrollment_History_EntryDates ON dbo.Enrollment_History (
    Entry_Date,
    Exit_Date)
    INCLUDE (
    ID,
    Campus_ID,
    Student_ID)
    WITH (DATA_COMPRESSION = PAGE)
    Adding the following index (and keeping the 1st) dropped it again, down to ~2,000 microseconds
    CREATE NONCLUSTERED INDEX ix_CalendarFAYDates_Detes ON dbo.Calendar_FAY_Dates (
    Start_B,
    End_E)
    INCLUDE (
    Start_E,
    End_B,
    ID,
    FY)
    WITH (DATA_COMPRESSION = PAGE)
    Keep in mind that 5 rows of data doesn't even begin to provide an accurate representation of read execution times against actual production data (the smallest changes in background processes on my computer caused the time to vary pretty drastically between
    executions).
    Anyway, the following is a quick & dirty way to test execution times when you're query tuning or checking the impact of different indexes on a query.
    DECLARE @b DATETIME2(7) = SYSDATETIME()
    SELECT eh.ID,
    eh.Campus_ID,
    eh.Student_ID,
    eh.Entry_Date,
    eh.Exit_Date,
    cfd.FY,
    case
    when eh.Entry_Date >= cfd.Start_B
    and eh.Entry_Date <= cfd.Start_E
    and eh.Exit_Date >=cfd.End_B
    and eh.Exit_Date <= cfd.End_E
    then 1 else 0 end as Is_FAY
    FROM dbo.Enrollment_History eh
    inner join dbo.Calendar_FAY_Dates cfd
    on eh.Entry_Date >= cfd.Start_B
    and eh.Exit_Date <= cfd.End_E
    SELECT DATEDIFF(mcs, @b, SYSDATETIME())
    HTH,
    Jason
    Jason Long

  • How do I modify an event's date range?

    I recently imported a series of photos from my camera, entering both an event name and description for the event. All photos but one were from this event. After deleting that single photo, the date range displayed underneath the event name still displays a range which includes the date from that single image. So now, even though all the images in the event are from the same day, the date of the event does not accurately depict this. How do I modify the date range?

    This doesn't address the date range problem which no amount of Adjusting Date and Time or Batch Changing will fix, instead LarryHN workaround seems to work great. I imported over 11,000 photos into 08 and lots of them had a date range from 98 to 2001. The Batch Rename fixed all but one batch whichb just would not budge until Larry's workaround with the new Event method.

Maybe you are looking for

  • Error message when trying to send .dng file from Lr to Ps

    If I am working in Lr (5.4) and try to send a .dng file from Lr to Photoshop CC (reinstalled latest version from Adobe.com today, 4/13/2014), I get this message: " Adobe Photoshop CC cannot be opened because of a problem. Check with the developer to

  • MSMP Work flow in GRC AC 10.0

    Hi All, Can someone please help me with Basic Work flow documentation for AC 10. I am  part of a implementation team and we are working on implementation of MSMP work flow in AC 10 , however i didnt have any prior experience with work flow configurat

  • Notification view?

    Hi all who read this :-) , My environment is Oracle9i Enterprise Edition Release 9.2.0.8.0. I need a query or view for the Notification workflow. I know the standard table is wf_notifications and the table wf_messages contain the notification message

  • Reg Field-Symbol value trasfer into variable

    Hi, I'm using one FIELD-SYMBOL in one of my program. I used this to catch Hotspot Fields in List Report. It catches that required field of BELNR. I read the Click event through that FIELD-SYMBOL. Now I used DATA: HOTSPOT(18) , "VALUE 'Document No',  

  • I want to put A5 text within a border symmetrically on an A4 sheet, any ideas?

    How can I put text on an A5 sheet so that it sits symmetrically into middle of  A4 sheet?