Find users with common dates in the respective date range

I am trying to find a simple logic to get users who have common dates in the date range while they were active.
Example:
User A -   Effective start - 1/1/2015  and  Effective End = 1/9/2015
User B -  Effective start - 1/5/2015  and  Effective End = 1/30/2015
User C - Effective start - 3/1/2015  and  Effective End = 4/9/2015
So for the above scenario my SQL code should capture UserA and UserB , as they have common active dates between them.

DECLARE @YourTable TABLE
UserName varchar(128),
EffectiveStart date,
EffectiveEnd date
INSERT INTO @YourTable VALUES
('User A', '1/1/2015', '1/9/2015'), ('User B', '1/5/2015', '1/30/2015'), ('User C', '3/1/2015', '4/9/2015')
SELECT *
FROM @YourTable AS t1, @YourTable AS t2
WHERE t1.UserName <> t2.UserName
AND (
t1.EffectiveStart BETWEEN t2.EffectiveStart AND t2.EffectiveEnd
OR t1.EffectiveEnd BETWEEN t2.EffectiveStart AND t2.EffectiveEnd
OR t2.EffectiveStart BETWEEN t1.EffectiveStart AND t1.EffectiveEnd
OR t2.EffectiveEnd BETWEEN t1.EffectiveStart AND t1.EffectiveEnd
A Fan of SSIS, SSRS and SSAS

Similar Messages

  • Users with license data

    Hi All,
    I have to make a report. I have to find users which are using only EP. I think i have to search them through license data. Can you please tell me how to search users with license data.
    I have tried SUIM. There is no field for license data. There is a report RSUSR080. But its kind of empty. it is not executed
    Please help me this.
    Thanks,
    Tajinder

    Hi,
    Actually the licencing thing you have to maintain while vraeting the user in the Licence Data tab . You can do this in su10 or su01.If this data is entered  during user creation, the table usr06 will display the same in the LIC_TYPE field.
    Pl refer Tcodes license_admin,  USMM etc for measuring users licence data. For details on licence pl refer the documents at https://websmp106.sap-ag.de/licenseauditing.
    Hope this helps.
    Pl award suitably.
    Regards

  • AD accounts find users with all capital letters

    Hello ,
    I am a noob , am searching online but can't find exactly what i need.
    So am posting here in hope some one will help me. :)
    I what to make a short powershell script that finds all users with capital letters from the second letter on.
    Example
    first name = Bob last name =Red    corect
    first name = BOB last name =RED  wrong
    i want to extract all the wrong names with capital letters in text file
    So my question is that possible and how can i do it in server 2008 r2.
    Thanks in Advance for any answers

    This is obviously not an Exchange question, but a PowerShell question.  You should probably post it in the scripting forums for completeness.
    That being said, you can try using -cmatch against a regex.  I used  -cmatch '[A-Za-z]+[A-Z]+' to test a name with later capital letters, and it appeared to work.
    [PS] C:\Scripts> "Willard" -cmatch '[A-Za-z]+[A-Z]+'
    False
    [PS] C:\Scripts> "WILLARD" -cmatch '[A-Za-z]+[A-Z]+'
    True
    [PS] C:\Scripts> "WillARD" -cmatch '[A-Za-z]+[A-Z]+'
    True
    [PS] C:\Scripts> "WillarD" -cmatch '[A-Za-z]+[A-Z]+'
    True
    [PS] C:\Scripts> "WiLlArD" -cmatch '[A-Za-z]+[A-Z]+'
    True
    So for your test, and using the Exchange commands (you can change them to the Windows 2008 AD commands), you'd run:
    Get-User | ? { $_.DisplayName -cmatch '[A-Za-z]+[A-Z]+' }

  • Failed to create a user with Mac Mini Server, the message "Failed to process the command writesettings" in the module "servermgr_sharing"

    Failed to create a user with Mac Mini Server, the message "Failed to process the command writesettings" in the module "servermgr_sharing"

    I have a Mac Mini with OS X Server 10.8.5 and Server 2.2.1 and have a problem to share the public folder.
    When I enter the Server application to indicate that I want to share the public folder on the network and assign user I get the following message appears
    And I can not share the folder.
    If I go from my i-mac get mac mini server view and access the public folder, but I can not open any of the files there.
    That I can do to fix this?
    thank you very much

  • Find totals of a date range and sum

    How do I find totals between a date range like from 0 up to 60 days from today, 61 to 90 days from today, 91-120 days, 120 and above. Please advise.
    Do I use a Add_Months function to convert to days?

    Try this,
    This may help you
    SQL> select sysdate,sysdate+interval '60' day from dual;
    SYSDATE     SYSDATE+INTERVAL'60'DAY
    5/5/2008 2: 7/4/2008 2:17:16 PM
    SQL>G.

  • Users with read access to the site unable to view Managed Metadata Navigation

    Hi everyone,
    I created a Managed Metadata service and created group, term-set and terms
    I gave read access to users
    I set up navigation to use Managed Navigation
    I am logged in as farm admin and able to view the navigation when i browse site. But user are not seeing navigation.
    One thing i noticed is when i give users full access or designer access to site they will be able to see the navigation. but i don't want to give users full access or designer access to the site.
    How can users with read only access to site can view Managed Metadata Navigation...Please help?

    Hi Sunil,
    Have you given your users permissions to actually read the MMS data from the service application?
    http://technet.microsoft.com/en-us/library/ff625176.aspx covers permissions on the MMS.
    Regards
    Paul.
    <<edit>> On reflection you might be hitting the issue in this Stackexchange post..
    http://sharepoint.stackexchange.com/questions/75636/permissions-and-managed-metadata-in-navigation Is yours behaving the same way?
    Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and helps prevent the same questions being asked multiple times.

  • Finder - Images With Orientation Data

    Hi,
    I'd like to discuss the way Finder handles images/photos with Orientation data embedded in them. I have a portrait photo here. When I open it with Preview it appears the correct way up, with its longest dimension running vertically. The same is true for Cover Flow and Quick Look. All of these methods show the photo the correct way up. However, when I view the file in Icon View or in List View in the Finder, the photo appears on its side, with its longest dimension running horizontally.
    My question is, why is this happening? If Preview, Cover Flow, Quick Look and even Safari understand Orientation data, why doesn't the Icon and List View modes of the Finder? Is this intentional or something that Apple forgot to implement?

    You need to have an application like  EXIF Viewer for Mac OS X  to check the files once you've exported them with the various checkboxes checked:
    Happy Holidays

  • 'Could not find user' with EAP-TLS in ACS

    Hi all,
    we are running ACS 4.2(1) Build 15 on a Win2003 member server and use the ACS for EAP-TLS with certificates (Microsoft-PKI) for WLAN authentication (WLC 4402, 6.0 and 4.2). We are using both machine and user authentication.
    Sometimes machine authentications fail with following message in AUTH.log:
    AUTH 11/01/2010 09:11:28 E 1395 1904 0x31cb External DB [NTAuthenDLL.dll]: Could not find user host/<xxxxxxxx>.com (0x5012)
    But some minutes/hours later the same machine can authenticate successful. Other machines never have this problem, no problems at all with user authentications.
    Does anyone have an idea where I can proceed with troubleshooting? I haven't found any related messages in server event logs. Are there any other logs where I can find reasons for these problems that are occuring only sometimes?
    Thanks
    Kai

    AUTH.log and RDS.log are two log file you need to look into on ACS side. Make sure the log level is set to "Full"
    You might need to check the log on AD side to see why it could not find this host.
    Comparing the logs between the working and non-working cases might be helpful.

  • Can you have two different users with itune accounts on the same computer?

    Can you have two different users with separate itune accounts on the same Ipad?

    Yes, create another user profile on the computer and each user can log into their own profile that way.

  • Workflow to populate "Assigned to User" with AD group of the "Assigned to User" is empty or Null to user is empty.

    I am updating roles and would like to use the [me] and [my group] tokens for views.  I am planning on updating all the templates to specify an ad group in the "Assigned to User" field that corresponds to the appropriately selected support
    group.  I would like to avoid having the "Assigned to User" blank (this could happen either via using a generic template, or when re-assigning workitems) so I think I need a workflow to remediate any workitems that have no Assigned to Users.
     There does not seem to be an easy way to do this just with a workflow configuration.  Do I need to create a workflow with the authoring tool?  Can I create a workflow that will compare a support group (enumeration?) and assign an appropriate
    AD group?

    probably the easiest way to do this would be to create a console workflow that runs on create (or update, if you want this to be reoccurring) and checks for the looks for the Display Name of the Assigned to user. This would only be populated if there was
    a legitimate user, and would be null otherwise.
    you could create console workflows for each support group (i.e. If Supportgroup = NumberA and AssignedtoUser.Displayname is blank) that applies a template that contains the correct user or group for that support group enum.
    other options are available, so let us know what you're ideal conditions are.

  • Find users with Role A and Role B but not Role C

    Hi all.
    How can I find users that have a combination of roles? The find user and user reports only have one line for selecting a role the user has. Is there a report that lets you select multiple roles? It would be really handy!
    Thanks,
    Jim

    If you haven't found it, there are likely no such reports, but it is easy to do that in a custom report. The problem is that its really badly documented how to make a custom report. But, it's really not that difficult if you know what to do. I will, when I get some spare time, post a guide here on how to make a custom report, the way I, and some other people, think it should be done.
    Roughly a custom report consists of three parts, a listing object, to make the report turn up in the report list, a report form, and the report WF. The trick is to know the correct subtypes, attributes and such.
    But take a look here Sunday, and there will possibly be a nice custom report guide posted.

  • Send Email for manager of the user with Login and Password the user.

    Hello everyone,
    I need to send an email to the manager of the user with login and password when it is created in AD.
    I already have a mail server configured in the IT Resource. It has some component of the IDM that solve this issue?
    Anyone you help me with the next steps?
    Thank you.

    Thank you for your attention.
    It did not work, I did another test to send email notifying you when the User change password.
    The following error message appears in oim_server1-diagnostic.log:
    [2011-08-08T19:21:30.865-03:00] [oim_server1] [NOTIFICATION] [] [oracle.iam.passwordmgmt.impl] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Resetting password
    [2011-08-08T19:21:30.936-03:00] [oim_server1] [NOTIFICATION] [IAM-0080013] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Kernel executing default validation with process id, event id, entity and operation 59,612.0.User.RESET_PASSWORD
    [2011-08-08T19:21:31.155-03:00] [oim_server1] [NOTIFICATION] [IAM-3050013] [oracle.iam.identity.usermgmt.impl] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Searching for users with the specified criteria.
    [2011-08-08T19:21:32.018-03:00] [oim_server1] [WARNING] [] [oracle.iam.passwordmgmt.impl] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Sending Reset Password Notification is not successful
    [2011-08-08T19:21:32.639-03:00] [oim_server1] [NOTIFICATION] [IAM-0080046] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Completed orchestration with action result - oracle.iam.platform.kernel.vo.EventResult@4fe0d018
    [2011-08-08T19:21:32.642-03:00] [oim_server1] [NOTIFICATION] [IAM-0080011] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 88a924181f586e03:-25ab9c82:131aa884464:-8000-0000000000008862,0] [APP: oim#11.1.1.3.0] Orchestration process with id 59,612 started running in a new thread.
    Edited by: Piza on 08/08/2011 15:24
    Edited by: Piza on 08/08/2011 15:26

  • Event Viewer: How to search and find event with specific text in the EventData

    Hello,
    When I use "Find..." option in the windows event log, it does not search within event's detail or text in <EventData> xml node on the event.
    Is there any easy, out of the box way to find all events that include an specific phrase in the <EventData> ?
    Thank you,

    Hi Allan,
    I‘m writing to check if the suggestions were helpful, if you have
    any questions, please feel free to let me know.
    If you have any feedback on our support,
    please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • File Count with selected date range

    Hi,
    Our requirement is to get the file count with selected date by the user from two sharepoint date time controls i.e. dtp1 and dtp2 into the data table. I am able to get the file count of specific folder from Pages library through below code. Now need to get
    the selected date range from two date time picker controls and check with the item created by is within the date range. If yes I need to get the file count.
    So please share your ideas/thoughts to do the same.
    SPList list =
    wikiweb.Lists["Pages"];
                        SPFolderCollection oFolders
    = list.RootFolder.SubFolders["foldername"].SubFolders;
                        DataTable dt
    = new DataTable();
                        dt.Columns.Add("Column1");
                        DataRow dr;
                        if (oFolders.Count
    > 0)
                            foreach (SPFolder oFolder in oFolders)
     if (!oFolder.Name.Equals("Forms"))
                                    dr
    = dt.NewRow(); 
    dr["Column1"] = oFolder.ItemCount.ToString();
    dt.Rows.Add(dr);
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    I have modified the code as below
    if((DateTime)(oFolder.Item.File.TimeCreated>dtFromDate.SelectedDate)&&(DateTime)(oFolder.Item.File.TimeCreated<dtToDate.SelectedDate))
    But still it is throwing the error.
    Please share your ideas on the same.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

  • Using a sparse lookup with a date range?

    Hey all,
    I have created a table (Benchmark_Lookup) that contains the following columns:
    start_date, end_date, section, benchmark
    I then have numerous logical tables (Eg Business Growth) that will all have a new logical column performing a sparse lookup on the above table to retrieve it's benchmark value.
    In the lookup table, I have multiple rows for the same section with different benchmarks differentiated by the date range that they were in effect.
    I have worked out how to perform this lookup using the following:
    lookup(SPARSE "bla".Benchmark_lookup"."Benchmark" ,0, "bla"."Business_Growth"."section")
    Unfortunately, the above is now bringing back duplicates as it's not working out what date range to select from.
    I have joined the lookup table (using a physical join) to my Time dimension by saying "business_date >= start_date and business_date <= end_Date" but that doesn't seem to work.
    Any ideas?

    Hi there,
    Neither of these examples help that much.
    I understand how the lookup function works but what happens if the lookup table has the following two rows:
    EFFECTIVE_FROM     EFFECTIVE_TO     SECTION     SCORE
    01/Jan/1900                 30/Jun/2013           test              1
    01/Jul/2013                  06/Jun/2079           test              2
    I need to use the following lookup rules:
    Business_Date >= Effective_From
    Business_Date <= Effective_To
    Section = 'Test'
    The lookup should therefore only ever return one row as the date is used to find the appropriate range.

Maybe you are looking for

  • How to do FCP upgrade from 4.1.1 to 6

    Am using FCP 4.1.1 on G4 dual proc mirror door and G4 powerbook. As I have been out of the country without access to techie stuff, I need to know if it is possible to upgrade from FCP 4.1.1 to FCP 6 utilizing the Studio 2 upgrade. Am considering putt

  • Inserting data in a table when the save button is pressed

    Hello all, I have a form displaying all fields in a table. it contains an adjustment column which is null by default and also an adjustment flag which is set to NO by default Now when the form is executed the user is able to add a value in that adjus

  • Please help: User cannot see webi report data

    Hi, I've got a wired problem here in my webi report. Basically I am located in Singapore and produced a webi report for our user in UK. The report looks totally fine with all the data shown correctly. But when our report user logged into the dashboar

  • Brother HL-2030,USB doesn't print PDF files

    Mac OS 10.6.7. Brother HL-2030, USB connection, doesn't print any kin of PDF files, or prints with fatal errors. Printer driver Brother HL-2030 series CUPS. Adobe Reader 10.0.3. . A HP Deskjet printer, with the same connection, prints correctly. I di

  • TNS-00517: Lost contact

    LSNRCTL> start Starting /u01/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 10.2.0.1.0 - Production System parameter file is /u01/oracle/product/10.2.0/db_1/network/admin/listener.ora Log messages written to /u01/or