Check duplicate items in two sharepoint lists

Hi, I have 2 separate sharepoint lists, both contrain user names. e.g: Jan Jaap.
I want sharepoint to automaticly compare those lists to see if there is any name in both lists and notify me about it. For example :
List 1: Firstname | Surname
          Jan           -    Jaap
          Steen        -    Vos
          george       -    bush
List 2: Firstname | Surname
          Jan           -    Jaap
          fox            -    washington
          brian         -    potter
both lists contain jan jaap. and i want sharepoint to notice that and send me and email about it :p.
Is this in any way possible?
Thanks in advance!!

You can use below tool
http://www.metalogix.com/help/Content%20Matrix%20Console/SharePoint%20Edition/002_HowTo/004_SharePointActions/003_CompareSitesAndLists.htm
Or if you want to do it programmatic try below:
http://sharepoint.stackexchange.com/questions/60917/compare-items-of-two-sharepoint-lists
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists["Employee"];
string query = @"<Where>
<Eq>
<FieldRef Name='Position' /><Value Type='Choice'>{0}</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name='Salary' Ascending='False' />
</OrderBy>";
query = string.Format(query, "Developer");
SPQuery spQuery = new SPQuery();
spQuery.Query = query;
SPListItemCollection items = list.GetItems(spQuery);
If this helped you resolve your issue, please mark it Answered

Similar Messages

  • Merging two SharePoint lists

    Hello !
    I have 2 SharePoint lists for years 2013 and 2014. I want to merge them and then pull the merged list into PowerPivot. I appreciate any help for that. I don't want to have 2 lists in PowerPivot, so I was wondering if there is anyway that I can merge these
    2 SharePoint lists?
    --update--
    I need to have live connection between the lists.  It means I want to have an automated process in place that can merge two lists once I pulled them into PowerPivot without any manual process of merging the lists.

    I don't know what rights you need to do this, but go to each site and do the following instructions:
    Click on Site Actions
    Click Site Settings
    Click Manage All Site Settings
    Under the Site Administration Group, click Content and Structure
    A window comes up that looks like Window's File Manager. You are in the current site, but you can see that you can browser to other sites in your site collection from the left panel.
    Locate the list you want to copy items from and click the name. You will see all the items, or at least in pages of 100.
    Change the paging quantity from 100 to 1000 in the top right, where it says "Show 100".
    Select all the items you want to copy. There's an icon that looks like a stack of papers, to select all items on this page.
    Click Actions in the toolbar, then click "Copy...". A dialog will come up of the current site collection.
    Choose the destination then, click Ok.
    Repeat this until you're done copying all items from the list.
    Be patient while the copy process completes, then switch to the other 49 sites. You cannot copy from one site collection to another. You can copy between
    subsites or sister sites. If you can't see the Content and Structure link in the Site Settings page, use the 12 hive URL: http://sitecollection/_layouts/sitemanager.aspx You'll
    have the items copied in no time without the help of IT/development.
    Courtesy links
    http://stackoverflow.com/questions/17956557/combine-multiple-sharepoint-lists-into-one
    https://www.nothingbutsharepoint.com/2012/05/11/how-to-link-two-lists-and-create-a-combined-view-in-sharepoint-2010-aspx/
    http://sharepoint.stackexchange.com/questions/34198/combining-multiple-lists-into-one
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/bcd2f069-ceec-42df-8989-a03e0cb017f3/to-join-two-sharepoint-list-having-a-common-colomn-without-using-joins?forum=sharepointgeneralprevious
    please 'Propose as answer' if it help you, also vote this as helpful if you like this reply.

  • How to update an existing item in a sharepoint list using the WSS adapter for Biztalk

    Is there a way that a record in SP list be updated using WSS adapter in biztalk ?
    BizTalk 2013 and SP 2013 ..
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • HTML + JQuery (CSOM) to add multiple item to a Sharepoint list and get their IDs

    Hi everyone.
    I try to use HTML + JQuery in CEWP to build some sort of analog of InfoPath's repeating table in order to be able to insert multiple items in a Sharepoint list using CSOM.
    The current task is to get the IDs of inserted items (in order to use those IDs later to add attachments to the list items) as soon as they are added to the list. I've tried several ways but couldn't get the IDs of all inserted items. Usually
    I get "-1" as an ID for every item except the last one, which returns me the correct ID. 
    Bellow is the code.
    <script src="/testsite1/SiteAssets/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/testsite1/SiteAssets/jquery.SPServices.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    var click = 1;
    $("#btn_id_1").click(function() {
    click ++;
    $("#tr_id_1").clone().appendTo("#tbl_id_1").attr("id", "tr_id_" + click.toString()).find("input").val("");
    $("#btn_id_2").click(function() {
    Save();
    function Save() {
    var ctx = new SP.ClientContext.get_current();
    var taskList = ctx.get_web().get_lists().getByTitle('Tasks');
    var taskItemInfo = new SP.ListItemCreationInformation();
    var vendor;
    var certname;
    var certid;
    $("#tbl_id_1 tr").each(function() {
    vendor = ($(this).find(".vendor")).val();
    certname = ($(this).find(".certname")).val();
    certid = ($(this).find(".certid")).val();
    newTask = taskList.addItem(taskItemInfo);
    newTask.set_item('Title', vendor);
    newTask.set_item('Request_', certname);
    newTask.set_item('h', certid);
    newTask.update();
    ctx.load(newTask);
    ctx.executeQueryAsync(addTaskSuccess, addTaskFailure);
    //timeout();
    function timeout() {
    alert ("!!!");
    function addTaskSuccess(sender, args) {
    alert(newTask.get_id());
    //AddAttachment(newTask.get_id())
    function addTaskFailure(sender, args) {
    //alert(newTask.get_id());
    alert("no");
    window.location = window.location.pathname;
    </script>
    <div id="div_id_1" class="div_class_1">
    <table id="tbl_id_1">
    <tbody>
    <tr id="tr_id_1">
    <td>Vendor:<br><input type="text" class="vendor" /></td>
    <td>Cert. Name:<br><input type="text" class="certname" /></td>
    <td>Cert. ID:<br><input type="text" class="certid" /></td>
    <td>Attachment:<br><input type="file" class="attachment" /></td>
    </tr>
    </tbody>
    </table>
    <div><button id="btn_id_1" type="button" width="10" height="10">+</button></div>
    <div><button id="btn_id_2" type="button">Save</button></div>
    </div>

    Here's a working solution (thanks to
    this guy)
    <script src="/testsite1/SiteAssets/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/testsite1/SiteAssets/jquery.SPServices.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var array = [];
    $(document).ready(function() {
    var click = 1;
    $("#btn_id_1").click(function() {
    click ++;
    $("#tr_id_1").clone().appendTo("#tbl_id_1").attr("id", "tr_id_" + click.toString()).find("input").val("");
    $("#btn_id_2").click(function() {
    //Save();
    //Call();
    var asyncPromises = Save();
    asyncPromises.done(function(result) {
    //alert(array.length);
    console.log(array.length);
    for (var i=0; i<array.length; i++) {
    //alert(array[i].get_id());
    console.log(array[i].get_id());
    asyncPromises.fail(function(result) {
    function Save() {
    var buildDeferredSaves = $.Deferred(function() {
    //var array = [];
    var ctx = new SP.ClientContext.get_current();
    var taskList = ctx.get_web().get_lists().getByTitle('Tasks');
    var taskItemInfo;
    var vendor;
    var certname;
    var certid;
    $("#tbl_id_1 tr").each(function() {
    vendor = ($(this).find(".vendor")).val();
    certname = ($(this).find(".certname")).val();
    certid = ($(this).find(".certid")).val();
    taskItemInfo = new SP.ListItemCreationInformation();
    newTask = taskList.addItem(taskItemInfo);
    newTask.set_item('Title', vendor);
    newTask.set_item('Request_', certname);
    newTask.set_item('h', certid);
    newTask.update();
    ctx.load(newTask);
    array.push(newTask);
    ctx.executeQueryAsync(
    function() {
    // Successful
    buildDeferredSaves.resolve();
    function(sender, args) {
    // Failure
    buildDeferredSaves.reject(args.get_message());
    return buildDeferredSaves.promise();
    </script>
    <div id="div_id_1" class="div_class_1">
    <table id="tbl_id_1">
    <tbody>
    <tr id="tr_id_1">
    <td>Vendor:<br><input type="text" class="vendor" /></td>
    <td>Cert. Name:<br><input type="text" class="certname" /></td>
    <td>Cert. ID:<br><input type="text" class="certid" /></td>
    <td>Attachment:<br><input type="file" class="attachment" /></td>
    </tr>
    </tbody>
    </table>
    <div><button id="btn_id_1" type="button" width="10" height="10">+</button></div>
    <div><button id="btn_id_2" type="button">Save</button></div>
    </div>

  • Get particular item count in sharepoint list using designer Workflow

    How to get specific item count in sharepoint list using designer Workflow 2013.
    For Example 
    Title  Count
    x        1
    y        1
    x        2
    x        3

    HI Thiru,
    Can you please elaborate your problem. Is that Title and count are your list columns you want to fetch the value of count column based on title?
    If my interpretation in not wrong, then it's not possible in SPD with the case you have mentioned in your question as Title='x' is having 3 different entries and SPD activity will always return first matching item and ignore the rest with warning message.
    Regards,
    Brij K

  • Help with Joining two SharePoint lists using LINQ

    Hi Guys,
    I have found many threads with this question. Although I had one doubt. I wanted to know that while performing a Join operation on two SharePoint Lists using LINQ does the column on which we are performing the join operation need to be a Lookup column?
    I was initially using CAML but since my lists does not contain lookup columns I switched to LINQ but my doubt still remains.
    I would really appreciate any help from you guys and also would appreciate if I could get some examples that I could refer to.
    Thank you

    Joins in LINQ to SharePoint 2010
    How to: Query Using LINQ to SharePoint
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Comparing two SharePoint Lists, three variables in each

    I have a data set in a SharePoint list, Column 1, 2, 3,4.
    I have a second data set in a SharePoint list, with the same columns 1-3 in it.
    I would like to create a workflow (I think) that when a new record is added to the first data set, it checks the second data set to see if there is a record with the same matching three records. If there is a match it would change column 4 in the first file
    to "TRUE".
    Looking for some help here... I know how to do a look up for one value, and even a lookup to look at two different values independently, but this lookup needs to make sure that all three columns in the record are a match.
    Thanks

    Hi,
    I'm assuming you mean for List 1 you have four fields and an additional field with the date (MyDate for example).
    And that in List 2 you have three fields plus two more date fields (EffectiveDate and ExpirationDate for example)
    For this scenario I would create 2 workflow variables:
    1. Combined (string) - same as before that builds up the three fields in List1
    2. List2Id - that gets the ID of the List Item in List2 that matches (if none match then List2Id will be 0) using the following settings:
    Data source: List2
    Field from source: ID (As List Item Id - IMPORTANT)
    Field: Combined
    Value:Variable:Combined
    Then use an if condition to check:
      If Variable: List2Id not equals 0
    then within this if condition create another sub if condition to check the following:
      If Current Item:MyDate is greater than or equal to List2:EffectiveDate
      AND Current Item:MyDate is less than or equal to List2:ExpirationDate
    If both conditions are true then update field four in List1 to True.
    Settings to get List2:EffectiveDate are below:
    Data source: List2
    Field from source: EffectiveDate (As Date/Time)
    Field: ID
    Value:Variable: List2Id (Return field as: Item Id - IMPORTANT)
    Settings to get List2:ExpirationDate are below:
    Data source: List2
    Field from source: ExpirationDate(As Date/Time)
    Field: ID
    Value:Variable: List2Id (Return field as: Item Id - IMPORTANT)

  • Split a text based on delimiter and add items to a sharepoint list using SPD workflow

    Hi All
    I have to store repeating table data into a sharepoint list. I have developed an approach to store data into a sharepoint list using web services as mentioned at
    http://www.bizsupportonline.net/infopath2007/how-to-submit-items-rows-repeating-table-infopath-sharepoint-list.htm. However this approach is working when form opened client only but when I opened it in browser this approach is giving error. Now I'm looking
    to promote repeating table data by combining items will a delimiter semi-colon (;). Please let me know how can I split the promoted field value using de-limiter and add it to a sharepoint list.
    Note:
    I'm working on SharePoint online 2010. (I don't have sharepoint on-premise, so I can't use SharePoint Object Model)
    If anybody know how to deal with this, please let me know.
    Thank you in advance.

    Hi Chuchendra,
    According to your description, my understanding is that you want to split the promoted field value in InfoPath form which was combined using semi-colon and add it to a SharePoint list.
    I recommend to submit the data to another SharePoint list first(use a column to store the value) and then create calculated columns to user formula to split the value, then use workflow to update the list where you want to add the value with the divided
    values.
    For example: the value is aa;bb;cc;dd.
    Based on the number of the semi-colons, we need to create one column to store the original value(named test for example), four calculated columns(v1,v2,v3,v4) to store the divided values and two more calculated columns(flag1,flag2) for use in the formula.
    v1: =LEFT([test],FIND(";",[test])-1)
    flag1: =RIGHT([test],LEN([test])-FIND(";",[test]))
    v2: =LEFT([flag1],FIND(";",[flag1])-1)
    flag2: =RIGHT([flag1],LEN([flag1])-FIND(";",[flag1]))
    v3: =LEFT([flag2],FIND(";",[flag2])-1)
    v4: =RIGHT([flag2],LEN([flag2])-FIND(";",[flag2]))
    We can also use Client Object Model to write code to split the value of the field.
    You can download the dll files form the link below:
    http://www.microsoft.com/en-in/download/details.aspx?id=21786
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Checked some items of multiple-selection list box when form loaded in infopath

    Hi
    I customize sharepoint list with infopath. I have multiple-selection list box and want to checked some items of that automatically when form loaded. how can do this?
    Thanks.

    Hi,
    According to your description, my understanding is that you want to pre-select some items in the Multiple-Selection List Box.
    I recommend to follow the steps below to achieve this goal:
    Click Default Values under Data tab in InfoPath, expand the dataFields and navigate to the Multiple-Selection List Box field.
    Set the Default Value of the Multiple-Selection List Box field.
    Right click the field under the Multiple-Selection List Box group, then select Add another Value Below and set the Default Value for this field.
    Repeat step3 based on the number of the items that you want to be pre-selected.
    More information are provided in the link below:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Is there a way to link two sharepoint lists together?

    Hi Guys,
    I currently have two lists (list A and list B), if a user enters a record into list A, i want it to populate the same record into list B...
    Is that possible?
    Alot of the columns are the same in both Lists, but the columns that arent in both list just wouldnt populate in the second list (List B).
    Any suggestions or information would be grateful. Thank you.

    Hi Soupi,
    According to your description, my understanding is that you want to populate a same item in list B when you create an item in list A.
    You can use a workflow to do it.
    Firstly, you need to install SharePoint Designer 2013. After installing, open your site with SharePoint Designer 2013. Then do as the followings:
    Click "Workflows" in the left panel, and click "List Workflow"->List A.
    Type a name, and select SharePoint 2010 platform.
    Then add the action "Copy ListItem" into the workflow, like the screenshot A below.
    Go back to the workflow settings, and set "Start workflow automatically when an item is created", like the screenshot B below.
    Screenshot A:
    Screenshot B:
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Duplicate Items in Sidebar-Not Listed In Volumes

    I hook up a number of external (USB & Firewire) external drives to my MacBook Pro when at my home office. All of a sudden these drives continue to show in the Sidebar after being ejected and unplugged. Once this starts, they continue to remain in the Sidebar multiple times until I reboot the machine. Unlike the other posts that I have seen (Doppelganger effect, etc...) these drives DO NOT show up in /Volumes. Ideas on how to fix ? ?

    For duplicates on side bar and save as menu.
    1. Drag all icons off bottom of your Finder sidebar.
    2. In Finder >> Preferences >> Sidebar UNcheck all options.
    3. navigate to ~(yourHome)/Library/Preferences and trash these two files:
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then log out and back in again. Or restart.
    (You will have to reset a few finder prefs the way you like them.)
    -mj

  • Run powershell command in app part on submitting item in O365 Sharepoint list.

    I need to fire an powershell command through app part as soon as i have submitted details or form on the list.
    As powershell command requires inputs, i have created list and a form into it, i mapped the column with the powershell input, but the commands is not running or firing, please help.
    Regards
    Mohit Jain

    Hi,
    According to your description, my understanding is that you want to run a Powershell command when submitting a form on the list to create mailbox for user.
    As your environment is Office 365, I suggest you can create a web service to call the PowerShell Command using C#. Then in the office 365 list, you can create a remote event receiver to trigger the web service to
    achieve it.
    Here are some detailed articles for your reference:
    http://msdn.microsoft.com/en-us/library/ms464040%28v=office.12%29.aspx
    http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
    http://msdn.microsoft.com/en-us/library/office/jj220043(v=office.15).aspx
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Showing updated items from two lists ?

    Hi SharePoint Experts,
    I have created two custom lists in top level site, For accomplishing my task, I have used DataView to show all items from the two lists order by modify. Of course, this DataView webpart showing data but which is not in proper way.
    And also show status column from workflow which is actually from different groups.
    Is dashboards  suitable to my task? Is dashboards capable to show data from two list ? also status column from workflow.
    Appreciate if any suggestions..
    Thank you.

    Hi,
    As you are using SharePoint 2013 you can use the Content search web part to display the data from multiple list.
    Please refer to the similar post, which has detailed steps how to use the content search web part.
    http://sharepoint.stackexchange.com/questions/112085/how-to-get-data-from-multiple-table-or-list-in-sharepoint-2013
    If you still persists to use the Dataview web part, please refer to the following article.
    http://sp2013.blogspot.de/2013/11/two-sharepoint-lists-in-dataview-linked.html
    Please don't forget to mark it as answered, if your problem resolved or helpful.

  • Open a SharePoint List item in Modal Pop up in SP 2013 fails after you filter or sort the list

    Sorry for the long post. This has been killing me. I had this script working perfectly fine in SharePoint 2010 (online) and basically i have a source custom list (list A) with a hyperlink column and a Destination List with say title and my name.
    Source List (list A) looks like this with these 2 columns
    Title    Test Link
    A         Link 1
    B         Link 2 
    C         Link 3
    Each of these links link to the actual list item in the destination list, so for example, link 1 is/sites/2013DevSite/Lists/Destination%20List/EditForm.aspx?ID=1
    So basically i want anytime the Link are clicked that point to another list's item to open in a modal dialog and the script below worked perfectly fine in SharePoint 2010 (online)
    <script language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
    <script language ="javascript" type="text/javascript">   
    jQuery(document).ready(function() {
    jQuery('a[href*="EditForm.aspx"]').each(function (i, e) {
    // Store the A tag's current href in a variable
    var currentHref = jQuery(e).attr('href');
    jQuery(e).attr({
    'href': 'javascript:void(0);', 
    // Use the stored href as argument for the ShowInModal functions parameter.
    'onclick': 'ShowInModal("' + currentHref + '");'
    function ShowInModal(href) {
    SP.UI.ModalDialog.showModalDialog({title: "Edit Item", url: href});    
    </script>
    All it does is find the href tags for that particular value Editform.aspx and the pop modal works in SP 2010 online. So the site page is designed in such a way there is a content editor web part with the reference to this javascript file and the sharepoint
    list is right beneath it and this worked perfectly opening in modal windows in SP 2010.
    Since migration to 2013, this is what exactly happens
    1.) when you come to the site page, the modal works,
    2.) If you filter or sort on say the Title or Test Link column in Source list (lets say you select the Value A), the script does not fire at all, if i hover over the hyperlink, the who hyperlink is shown and does not open the hyperlink in the modal pop up.
    - This is important because i want to be able to sort on a particular item...
    Could someone please let me know what am i doing wrong and why is this not working when i sort the list. Thanks for all the help.
    Once again i am trying to open a sharepoint list item in Sharepoint 2013 from another list using Jquery

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • Displaying a SharePoint List in a ListView Control with Grouping by Date

    Dear All
    I have created a ListView to display items from a SharePoint list:
    <asp:ListView ID="UpAndComingEventsLV" runat="server">
    <LayoutTemplate>
    <ul>
    <li id="itemPlaceholder" runat="server" />
    </ul>
    </LayoutTemplate>
    <ItemTemplate>
    <li id="Li1" runat="server">
    <asp:Literal ID="CurrentDate" runat="server" />
    <%#Eval("Title")%> <%#Eval("Event_x0020_Category")%> <%#Eval("EventDate", "{0:HH:mm}")%>
    </li>
    </ItemTemplate>
    </asp:ListView>
    To perform the binding and then display the date I'm doing the following:
    Using oSiteCollection As New SPSite(_ListPath)
    Using web As SPWeb = oSiteCollection.OpenWeb()
    List = web.GetList(_ListPath)
    End Using
    End Using
    Dim Query As New SPQuery
    Query.Query = "<Where><And><Eq><FieldRef Name='Status' /><Value Type='Choice'>Approved</Value></Eq><Geq><FieldRef Name='EventDate' /><Value Type='DateTime'><Today Offset='4' /></Value></Geq></And></Where><OrderBy><FieldRef Name='EventDate' /></OrderBy>"
    'Query.RowLimit = 1
    Query.ViewFields = "<FieldRef Name='Event_x0020_Category' /><FieldRef Name='Title' /><FieldRef Name='EventDate' /></ViewFields>"
    Dim ItemColl As SPListItemCollection = List.GetItems(Query)
    UpAndComingEventsLV.DataSource = ItemColl.GetDataTable
    UpAndComingEventsLV.DataBind()
    dfgdfgfg
    I would like to group my events by date though, rather than display the date against each row. To make things even more complicated, I would like to use friendly names like Today, Tomorrow, Monday, Tuesday instead of dates:
    TODAY
    Event number one
    Event number two
    Event number three
    TOMORROW
    Event number 4
    Event number 5
    MONDAY
    Event number 6
    Event number 7
    At the moment, I've created a ItemDataBound event on the ListView control and I have been able to display the Today, Tomorrow, Monday etc bit but I can't figure out the best way to perform the grouping. Incidentally, I only want to group on the date not
    on time:
    Private Sub UpAndComingEventsLV_ItemDataBound(sender As Object, e As Web.UI.WebControls.ListViewItemEventArgs) Handles UpAndComingEventsLV.ItemDataBound
    If e.Item.ItemType = Web.UI.WebControls.ListViewItemType.DataItem Then
    'Retrieve data item
    Dim DataItem As ListViewDataItem = DirectCast(e.Item, ListViewDataItem)
    Dim RowView As DataRowView = DirectCast(DataItem.DataItem, DataRowView)
    Dim EventDate As DateTime = RowView("EventDate")
    'Get literal control
    Dim CurrentDate As Literal = e.Item.FindControl("CurrentDate")
    'Display friendly date
    If Not IsNothing(CurrentDate) Then
    Select Case EventDate.Date
    Case Is = Now.Date
    CurrentDate.Text = "Today"
    Case Is = Now.Date.AddDays(1)
    CurrentDate.Text = "Tomorrow"
    Case Is = Now.Date.AddDays(2)
    CurrentDate.Text = Now.Date.AddDays(2).DayOfWeek.ToString
    Case Is = Now.Date.AddDays(3)
    CurrentDate.Text = Now.Date.AddDays(3).DayOfWeek.ToString
    Case Is = Now.Date.AddDays(4)
    CurrentDate.Text = Now.Date.AddDays(4).DayOfWeek.ToString
    Case Is = Now.Date.AddDays(5)
    CurrentDate.Text = Now.Date.AddDays(5).DayOfWeek.ToString
    Case Is = Now.Date.AddDays(6)
    CurrentDate.Text = Now.Date.AddDays(6).DayOfWeek.ToString
    End Select
    Else
    CurrentDate.Text = "-"
    End If
    End If
    End Sub
    Please could you help me understand the best way to perform the grouping by date?
    Any help or advice is greatly appreciated!
    Many thanks
    Daniel

    When I've done this in the past I've always used a calculated field that translated the days into the groupings I wanted.  You couldn't do quite the groupings that you list above, but it would give you categories to group on.  You could then
    apply the groupings in the base view.  Then you could use the Row Databound event to change the labels on the Groupings at runtime to the ones you want to use.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

Maybe you are looking for