Determining Date Range from Pay Date Information

I have a table of employees with different pay dates because they are college interns and they leave at different dates, so their most recent pay date will be different. I have created a query to find the most recent pay date.  The pay periods are bi-weekly.
I have a table called tblPayPeriods with all of the pay dates. I have created a query that pulls the most current pay date for each intern and I want to match that pay date to the pay date of the Pay Periods table and increment back twenty pay periods. 
Once I have determined the oldest pay date I want to use that range for a calculation for average hours ultimately.  I can handle the average hours part but I'm having trouble with the pay dates part of this. Any suggestions would be appreciated. 
Thanks!
Here is the SQL statement to find the most current pay date for each intern:
SELECT tblMeasurementPeriod.EENum, Max(tblMeasurementPeriod.[Pay Date]) AS [MaxOfPay Date]
FROM tblEmployees INNER JOIN tblMeasurementPeriod ON tblEmployees.[EE Num] = tblMeasurementPeriod.EENum
WHERE (((tblEmployees.[Measurement Period])="initial"))
GROUP BY tblMeasurementPeriod.EENum;
Here is the SQL statement using the query joined to the pay date table:
SELECT qryFindLatestPayDateforINITIAL.EENum, qryFindLatestPayDateforINITIAL.[MaxOfPay Date], tblPayDate.[Pay Date]
FROM qryFindLatestPayDateforINITIAL INNER JOIN tblPayDate ON qryFindLatestPayDateforINITIAL.[MaxOfPay Date] = tblPayDate.[Pay Date];
Alicia Hunsberger

You have the Intern Last Pay Date (LPD)
You want to match that LPD to the pay date of the Pay Periods table...
** so the first question is - are you able to? what is the obstacle on this?
and increment back twenty pay periods
** is there a fixed math you can rely on, such as subtract 180 days?...will that work to determine the pay date 20 periods previously?  it would be great if the pay periods had a sequential integer in their record - - - that would make it easy....

Similar Messages

  • Function Module which will take Wekk No & Return date range (from & To dat)

    Hello everyone,
    I need a Function Module which will take Week No as an input Parameter & return me the date range
    (From date & To date of that week) .
    Thanks in advance!
    Cheers!
    Moderator message: date calculation questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 2, 2010 5:25 PM

    Hi,
         Please write the below logic..
    data : v_date11 type sy-datum,
              monday    type sy-datum,
              sunday  type sy-datum,
              v_count1 type i .
    *v_count1 = 20 * 7.            "   Say U want details for 20th week , or give a parameter for week and multiply with 7*
    v_date11 = '20100101'.     "   take the starting day of the year ....
    v_date11 = v_date11 + v_count1.   " add to the date
    CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'   <-- call this FM
    EXPORTING
       DATE          = v_date11
    IMPORTING
      WEEK          = WEEK
       MONDAY        = MONDAY <-- will have the week starting day
       SUNDAY        = SUNDAY
    Regards,
    Srini.

  • Calculate the date range from entered date

    HI
    My requirement is to get the data in a perticular intervals of posting date.
    Directly we can create a variable with interval on posting Date to have the required data but Here we need two have two varibles because in one varibale user enters posting date and in second variable user enters any number like 1,2,3....etc
    Let's say user enetered posting date as 30.08.2010 in the first variable and number 4 in the second variable.
    Finally out put range should be calculted from entred posting date 30.08.2010  date to four days back  
    i.e output  should be appear in the report  from 27.08.2010 to 30.08.2010.
    My question i can create first avariable on posting Date but  where shoud i create the second variable on which field.
    Please help me on this..points will be awrded.
    Regards,
    Siva Thottempudi.

    R you talking about the below to create new variable on the existing key figure
    Selecting Variables
    When you select characteristic values in the query definition, you can also select variables instead of fixed values. These act as placeholders and are only filled with fixed values when the query is executed.
    When selecting variables, you can also define new variables, change variables, or delete variables. These functions are always available to the right of the selection of the variable type.
    Selecting Variables
    1.      Choose Show ® Variables.
    2.      Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
    3.      Select one (or, in exceptional cases, more than one) variable from the list of available variables in the left window and add them (using the right arrow) to the right Selection window.
    Selecting Variable Value Range Limits
    1.      Choose Show ® Value Ranges.
    2.      Select your required operator from the dropdown box. You can choose from the following operators:
    ○       Between
    ○       Less Than or Equal to
    ○       Greater Than or Equal to
    ○       Less Than
    ○       Greater Than
    3.      Select the required value or values for the value range and choose . The input help appears in a new dialog box and displays the selection of variables under Show  ® Variables.
    4.      Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
    5.      Select the required variable and choose OK.
    6.      For the Between operator, two single values are required for the interval limits; the system automatically displays two dropdown boxes. In this case, repeat steps 3-5.
    7.      After you have set the value range, choose OK.
    8.      Add the selection to the right Selection window using the right arrow.

  • [DIAdem] How can I trace a data range from a data channel?

    Hello,
    I am looking for a way to trace a range of data from a data channel using DIAdem script.
    Right now, I can only trace an entire data channel.
    Is it possible? I do not want to split a data channel in order to trace a part of it...
    Thank you.
    Regards

    Hello Tenanio,
    I believe this will answer your question:
    I am assuming in my code that you have a VIEW layout with a sheet called "Sheet 0" which has a 2D-graph in the top area (as can be seen from the screenshot below):
    Copy this Code into SCRIPT and run it, it should display the data the way you had described:
    View.Sheets(1).Cursor.Type = "Band"
    View.CoordinateWnd.Visible = TRUE
    View.ActiveSheet.Cursor.X1 = ChD(305,"Date_Mesure")
    View.ActiveSheet.Cursor.X2 = ChD(320,"Date_Mesure")
    View.Sheets("Sheet 0").Areas("Area : 1").DisplayObj.XScalingMode = "RangeScroll"
    call wndshow("View")
     Please let me know if this works for you and if you have any additional question.
           Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Reports / intranet/ In some detail,  the user will input a date range from and 2 and will out put the records in the int

    Hello there,
    I am totally green in web development.
    my goal is to, for the user will input a date range from and
    to and will out put the records in the intranet when they press a
    button.
    However, the good news is: I have experience in programming.
    I have written applications for desktop in VB>NET and I
    understand RDBMS /sql concepts .
    But CF and WEB development is new to me.
    My current projects involves in connecting to DB and testing
    it. (it works fine)
    And outputting reports by to a intranet page. (records)
    i need help on how to start this asap. I will even do some
    practice at home.
    Tools I have at work
    • Development server(test)
    • Home site.
    • Toad for db connection.
    • Html reference guide
    • Cf dummies book.
    How can start my projects.
    (ex. Create cf, outputpage?)
    seriously, I am new to this.
    Thanks.

    Well, I had a really nice response with some concepts and
    ideas for you to practise on etc, but these dumb forums timed out
    and I lost it all
    If you want to pop me an email we could probably do a few
    exercises together that way - or even by MSN Messenger if you want.

  • Date range for key date in hierarchy

    Dear Friends,
    Is there a work around for single key date restriction for time dependent hierarchy.Bcos i can only select one key date in teh report for my hierarchy so that it will take that hierarchy which falls in this date and display the result accordingly.
    But is there a way to select the date range for key date so that more than one hierarchy can be used to display my report accrding to the time range.
    Say,i have 4 hierarchies (time dependent) like v1,v2,v3,v4 and v5 for jan 08,feb 08,mar 08,apr 08 & may 08 respectively.
    In my report,i want to display the result for the time interval say mar to May.
    So my report should diplay the result according to the 3 different hierarchies for the time period i.e.v3,v4&v5.
    How do i acheive this.
    Thanks.
    ragu

    Hi
    I think we may do with the Char with text with replecement path.
    take time char as Calmonth and set the offet value as -1 and -2 and design the report and use the hierarchies in that query.
    Am not surt it willwork but better to try with this.

  • Will any of DDL command trigger a data flush from the data buffer to disk?

    Will any of DDL command trigger a data flush from the data buffer to disk?---No.164

    I mean if I issue the DDL commands Such as DROP, TRUNCAE, CREATE, Can these commands trigger a data flush action?

  • Data deleted in ODS, data coming from the data source : 2LIS_11_VASCL

    Friends,
    I have situation :
    Data deleted in ODS, data coming from the data source : 2LIS_11_VASCL.
    when for the above ods and the data source when trying to delete the request whole data got delted.
    All the data got deleted in the fore ground. no background job has been generated for this.
    I ma really worried abt this issues. can u please tell me what should be the possibilities for this issue.
    Many Thanks
    VSM

    Hi,
    I suppose you want to know the possibilitiy of getting the data.
    If the entire data is being deleted, you can reload the data from source system.
    Load the setup table for your application. Then carry out init request.
    Please note that you would have to take a transaction-free period for carrying out this activity so that no data is missed.
    Once this is done, delta queues will again start filling up.

  • Pass a date Range from VB to a parameter

    Hello,
    I'm thinking this is an easy question, but ...
    In a Visual Studio 2008 VB program, I'm allowing the user to pick a starting and ending date from DateTimePickers. (works fiine).
    In a CR 2008 report, I have a paramter defined as "pDateRange",  Type = date, Allow Range Values = Yes.
    In the Record Selection, I use a formula of {tblData.INSTALLDT} in {?Date_Range}.
    When I run the report, I can enter the date ranges in via the Enter Values prompt screen, and it works file,
    All I need to know is - how do I pass the dates the user selected in the VB program to the pDateRange parameter?
    Thanks very much,
    Carl

    Thanks Ludek for the reply.
    Unfortunately, I canu2019t seem to puzzle this out.  None of the examples seem to work.  This is an example, along with their comments.
    I get the error "The parameter field current values cannot contain range values because the ValueRangeKind property is set to discrete." on the last line.
    I could REALLY use some help getting past this issue.
           Dim myReportDocument As New CRS_Tab_Prod_Org_Cnt_Params2
            Dim crParameterFieldDefinitions As ParameterFieldDefinitions
            Dim crParameterFieldDefinition As ParameterFieldDefinition
            Dim crParameterValues As ParameterValues
            Dim crParameterRangeValue As ParameterRangeValue
            crParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
            'Access the individual subreport parameter field "Date_Range"
            crParameterFieldDefinition = crParameterFieldDefinitions.Item("Date_Range")
            'Cast the variable to hold the values to pass to the Report before execution
            crParameterValues = crParameterFieldDefinition.CurrentValues
            'Cast the variable to hold the range value for the parameter
            crParameterRangeValue = New ParameterRangeValue()
            'Set the Date range and include the upper and lower bounds. Use the Cdate function as insurance
            'to ensure that the value passed is cast to the appropriate data type
            With crParameterRangeValue
                .EndValue = CDate("1/1/1997")
                .LowerBoundType = RangeBoundType.BoundInclusive
                .StartValue = CDate("12/20/1997")
                .UpperBoundType = RangeBoundType.BoundInclusive
            End With
            'Apply the Date range to the values to be passed to the Report
            crParameterValues.Add(crParameterRangeValue)
            'Pass the parameter values back to the report
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
    Thanks for your help,
    Carl

  • Passing DateArray or Date Range from formula result to Select Expert

    Is there a way to pass Two (2) dates from a single formula to the Select Expert?
    I calculate Beginning and Ending dates of periods ie: fiscal year to date, calendar year to date, last calendar quarter.  I would like to pass both the beginning and end date to a formula in the Select Expert.
    Please show code samples if possible.
    Thanks

    In your selection criteria, have code similar to this:
    datevar begindate;  // this is from your formula for date range
    datevar enddate;  // this is from your formula for date range
    {database.datefield} in begindate to enddate;
    Edited by: Sanjay Kodidine on Jun 27, 2009 11:43 AM

  • Date deviates from Due Date range??

    Hi All,
             When i'm trying to add a back dated A/R Invoice, I'm getting an error message that the date deviates from the due date range. I have selected the appropriate posting period for this and also have checked the document numbering. In the Journal entry, i can see that the due date is 02/04/09 where as in the A/R Invoice, i have given the due date as 29/03/09. Now is this the reason for this error? Any suggestions??
    Thanks in advance,
    Joseph

    Double check your period setting, Due Date From and To must cover the Due date for the document you are posting.  Document Date From and To range should be good too.
    Thanks,
    Gordon

  • Select Between two date ranges from xml file

    Hi ,
    I have a column date_ with datatype VARCHAR2(150) it stores
    data as
    05/19/2010 11:23 AM
    05/20/2010 12:23 PM
    05/22/2010 11:23 AM
    05/25/2010 11:23 AM
    i have to select all the rows between 05/19/2010 and 05/22/2010 how to do that this column is in xml file

    I have a table wit two fields
    Field1 is integer and field2 is xmltype
    in the xmltype i store an xml file
    <ParentNode>
    <Node>
    <Cat>1</Cat>
    <Date>05/19/2010 11:23 AM </Date>
    </Node>
    <Node>
    <Cat>2</Cat>
    <Date>05/20/2010 12:23 PM </Date>
    </Node>
    <Node>
    <Cat>3</Cat>
    <Date>05/22/2010 11:23 AM </Date>
    </Node>
    </Parentnode>
    I am using teh below query to retrive teh result
    SELECT T.Feild1, XML.* FROM Tablename T,
    XMLTable( 'Parentnod/Node' PASSING T.Feild2 COLUMNS Cat NUMBER PATH 'Cat' ,
    DATE_ VARCHAR2(100) PATH 'Date'
    )XML where cat >1;
    now i have to do teh same to select the rows between two date range 05/19/2010 and 05/21/2010
    hope i am able to make teh question simple

  • Help - Date Range from a column

    I have a column in one of my tables that contains the birthdate of a person and it's format is like this:
    YYYYMMDD
    sample ( 19740226 )
    I need to find all the people who are between 35-45 years old from this date: 20080529
    What would be the best way to do this, sorry new to date manipulation, thanks a lot of your help ahead of time.

    Hi,
    MONTHS_BETWEEN and TO_DATE are built-in functions. Like all built-in functions, you can learn about them by reading the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/index.htm
    MONTHS_BETWEEN returns an "age" in months. In this case, it's more convenient to think in terms of years, so I divided the number of months by 12 to get the number of years.
    I assumed table_name.column_name was a string in YYYYMMDD format, such as '19701231'. If any row has a value (NULLs are okay) that is not in this format, you will get a run-time error. For example, if a short string, like '197012', is encountered, you'll get the ORA_01840 error.
    Apparently, that column is not in that format, at least not always. How you can get the information you need depends on exactly what is in that column. Find out what datatype it is (DATE, NUMBER, VARCHAR2), and, if it is not a DATE, post some samples of actual values.

  • Date range From Fiscal period range

    Hi All,
    How can we get the date range for a given fiscal period range?
    please help.
    Thanks
    Gaurav Mittal

    hi
    good
    pls check this code
    declare a range like
    ranges: r_date for s021-spmon. (declare as per your data type for the date)
    in initialization event write.
    r_date-low = '012007'. (enter the required lower range of value)
    r_date-sign = 'I'.
    r_date-option = 'BT'.
    r_date-high = '122007'.
    append r_date.
    now use the r_date field in the program code.
    thanks
    mrutyun^

  • Date Range Within a Date Range

    I'm suffering from a mental block on this one and I'm hoping
    someone here can help. What I need to do is determine how many date
    ranges are between a broader date range. For example a school year
    runs from 9/1 to 6/30 or 180 work days. What I need to do is
    compute the number of 9/1 to 6/30 periods between say 1/1/2007 and
    9/30/2009. The result of this find is used in othere calculations
    in a rather complex report. Any help is appreciated.

    Yet another method...
    <cfset start_date = DateFormat('01/01/2007',
    'mm/dd/yyyy')>
    <cfset end_date = DateFormat('09/30/2009',
    'mm/dd/yyyy')>
    <cfset start_year = DatePart('yyyy', start_date)>
    <cfset end_year = DatePart('yyyy', end_date)>
    <cfset schoolyear_start = '09/01/'>
    <cfset schoolyear_end = '06/30/'>
    <cfset count = 0>
    <cfloop index="rec" from="#start_year#"
    to="#end_year#">
    <cfset tmp_start = DateFormat('#schoolyear_start##rec#',
    'mm/dd/yyyy')>
    <cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
    'mm/dd/yyyy')>
    <cfif DateCompare(tmp_start,start_date) gt -1 and
    DateCompare(tmp_end, end_date) eq -1>
    <cfset count = count + 1>
    </cfif>
    </cfloop>
    <cfoutput>
    <br>There are #count# school year periods between
    #start_date# and #end_date#
    </cfoutput>

Maybe you are looking for

  • Cannot connect to XE after following "How To" Windows XP Pro SP2

    Hi Sharon and everyone, I have read all related posts, the how-to and tried many times including restarting XE but still cannot connect using SQL Developer. I already have a small schema created using ths SQL Window of XE and can connect using "Toolk

  • How can I reset my iPad that I forgot the password to my linked account.

    My iPad is linked to an old gmail account of mine that I believe has been hacked.  I have tried everything to reset my gmail password and it hasn't worked.  I think someone changed all of my information.  I have tried to reset my iPad by holding down

  • How do I populate a popup button?

    Well, I've found this snippet of code here and in various place around the 'net: tell window 1     tell menu of popup button 1         delete every menu item         repeat with catListItem in catList             make new menu item at end of menu ite

  • Got error when trying to generate Java proxy jar file for webservice

    Hi, I am having a warning message when trying to generate java proxy jar file on weblogic8.1 webservice test web app, the message is as follows: "Warning Failed to generate client proxy from WSDL definition for this service. Prescription Please verif

  • Bad DVD Resolution

    Hello! I am having an issue creating a nice clean DVD. I have a series of JPG files that are 300dpi (2400x1080). Basically I import them into iPhoto to be used for iDVD (version 7.0.4). I then "insert slideshow" in iDVD and put a simple fade transiti