Get entries later than a given date

Hello,
I'm trying to implement a method wich will return me the entries from the service where the createdAt field is greater than the given Date. So i done this:
Timestamp timeDay = new Timestamp(2008, 5, 1, 0, 0, 0, 0);
try{
        nameFilter = new QueryFilter(name);
        dateFilter = new QueryFilter(timeDay, ">=");
        list = local.findByNameAndCreatedAt(dateFilter, nameFilter);
In the Service Browser I can see an Entrie with the Value
2008-05-08T12:49:50.380
So it must return me an result, but it doesn't, just an empty List. What am I doing wrong?
Greetings
Christoph König

The Problem was, that I generated the Timestamp from util.Date. when i create the timestamp for a GregorianCalender it works

Similar Messages

  • Request end must be later than req start date

    Request end date must be later than request start date
    Any explaination, what configuration I need to carry on to clear the issue
    Regards,
    Ajay

    Hi,
    I am also getting same error while I create a new service request. I have assigned the date rule for both start date and end date. Request start date is today's date and end date is today's date+3 days. i can see the dates on screen, but still when I save I am getting Requested end date must be later than requested start date. Please let me know am I missing something here.
    Regards,
    Reddy

  • Requested end date must be later than requested start date

    Hi,
    I am getting an error after the creating the support ticket as "Requested end date must be later than requested start date".
    Please advise the solution.
    Regards,
    Rajesh Kumar.R

    Hi Raj,
    If you look for this message in DEBUG, youu2019ll find, that it is raised in functional module CRM_DATES_SERVICE_IR. That FM is called if your date type equals to constants GC_APPOINTMENT_TYPE-SRV_CUST_BEG (SRV_CUST_BEG) or GC_APPOINTMENT_TYPE-SRV_CUST_END (SRV_CUST_END).
    So, I can say that itu2019s some kind of standard check inside CRM core, and you canu2019t turn it off.
    And the workaround variants are listed earlier:
    -     You can fill the date SRV_CUST_END with some rule as Mohammed has suggested (even with dumb ISM_INFINITE which will put 31.12.9999 and it will be obvious that user didnu2019t change it)
    -     You can move to Z* date types, like you said, and checku2019s wonu2019t run
    -     And finally, you can try to delete this error message using BADI method CRM_APPT_CHECK_DEPENDENCIES, CRM_APPOINTMENT_BADI (as I remember it runs after this standard check). But I wouldnu2019t recommend doing it, because CRM_DATES_SERVICE_IR could be called not only in this moment and errors could appear in random placesu2026
    Best Regards,
    Vadim Shmarin

  • Primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    You are welcome.
    Sorting and organizing photos on IOS devices is one of the things that really need to be improved. It looks like the developers simply did not expect the users to want to keep large photo libraries on an IOS device, where the ordering would matter. I'd send feedback to the developer team, so that they see, what the users want and need:
    You can use this form:  Apple - iPhoto - Feedback

  • Get the later of the 4 dates.

    Hope I can get help, I am green to this but I wish to learn for my reports.
    I have 4 dates column.
    Date1
    Date2
    Date3
    Date4
    From table_date
    I need get the later of the 4 dates.
    I understand there is a greatest function
    But I don’t know if this is what you need.
    Also
    Do I need to do any conversion as far as date goes?
    it could ne any of the date fields for each record.
    i wish for the output to be AS current_date Field
    Thanks.

    Hi,
    Do you want to know what column date is greatest ?
    So, try :
      1* create table tbl8(date1 date, date2 date, date3 date, date4 date)
    SQL> /
    Table created.
    SQL> insert into tbl8 values (sysdate,sysdate+1,sysdate+2,sysdate+4);
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into tbl8 values (sysdate+5,sysdate+10,sysdate+9,sysdate-5)
    SQL> /
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1  select col_name, dt
      2  from
      3  (select 'date1' col_name, date1 as dt from tbl8 union all
      4   select 'date2' col_name, date2 as dt from tbl8 union all
      5   select 'date3' col_name, date3 as dt from tbl8 union all
      6   select 'date4' col_name, date4 as dt from tbl8
      7   order by dt desc)
      8* where rownum=1
    SQL> /
    COL_N DT
    date2 01/05/06
    SQL> Nicolas.

  • Production finish date is later than order finish date?

    In my company, most of the plan orders in MD04 have an exception message "64 Production finish date is later than order finish date". The plan strategy of the materials are 40. The plan orders are created from Scheduling Agreements or Independent Requirements.  We set 'Scheduling' as 2(lead time) in the MD01/MD02. The self-production time in material master data is 0. The schedule margin code is 000 which all the parameters are 0.
    For a example, we create a requirement on 2007.04.24. After MRP run, plan order generate. It's basic date will be 2007.04.24, but the production date IS 2007.04.25. All the plan order like that, the production date are always later than the basic date for one day.
    Could someone tell me why? and how to settle this problem?
    Thank you in advance!

    Hi,
    check scheduling parameters for planned orders and scheduling parameters
    for production orders.In that set the various indicators like
    adjust basic dates to order start date
    do not adjust basic dates to order start dates and try.
    Tcode opu3 / opu5
    Thanks,
    s.nandhakumar

  • The determined activity date 03/24/2009 must be later than the system date

    Hello everyone!
    I am creating a contract but this error message appears when I put a validity date: "The determined activity date 03/24/2009 must be later than the system date". Where in IMG can I adjust this? Thank you.

    no one responded.

  • Set restriction to get messages older than a specific date using EWS?

    Hi, I'm new working with EWS and I have found some code to set a restriction to help me filter messages "between" to dates, but I need to be able to obtain emails that are "older" than a specific date so I can delete them.  My application needs to be
    able to clean up a mailbox to only to keep up to so many days/weeks worth of emails.  The code I have to search for emails that works
    between dates is:
    public void SetDateRestriction(FindItemType findItemRequest)
    DateTime dateStart = DateTime.Now;
    DateTime dateEnd = DateTime.Today.AddDays(-180);
    PathToUnindexedFieldType dateSentPath = new PathToUnindexedFieldType();
    dateSentPath.FieldURI = UnindexedFieldURIType.itemDateTimeSent;
    IsGreaterThanOrEqualToType isGreaterThanOrEqual = new IsGreaterThanOrEqualToType();
    isGreaterThanOrEqual.Item = dateSentPath;
    FieldURIOrConstantType dateConstant = new FieldURIOrConstantType();
    ConstantValueType dateConstantValue = new ConstantValueType();
    //dateConstantValue.Value = string.Format("{0}-{1}-{2}T00:00:00Z", dateStart.Year.ToString(), dateStart.Month.ToString(), dateStart.Day.ToString());
    dateConstantValue.Value = dateStart.ToUniversalTime().ToString("yyyy-MM-ddT00:00:00Z");
    dateConstant.Item = dateConstantValue;
    isGreaterThanOrEqual.FieldURIOrConstant = dateConstant;
    // less than or equal to
    PathToUnindexedFieldType dateSentPath1 = new PathToUnindexedFieldType();
    dateSentPath1.FieldURI = UnindexedFieldURIType.itemDateTimeSent;
    IsLessThanOrEqualToType lessThanOrEqualTo = new IsLessThanOrEqualToType();
    lessThanOrEqualTo.Item = dateSentPath1;
    FieldURIOrConstantType dateConstant1 = new FieldURIOrConstantType();
    ConstantValueType dateConstantValue1 = new ConstantValueType();
    //dateConstantValue1.Value = string.Format("{0}-{1}-{2}T00:00:00Z", dateEnd.Year.ToString(), dateEnd.Month.ToString(), dateEnd.Day.ToString());
    dateConstantValue1.Value = dateEnd.ToUniversalTime().ToString("yyyy-MM-ddT00:00:00Z");
    dateConstant1.Item = dateConstantValue1;
    lessThanOrEqualTo.FieldURIOrConstant = dateConstant1;
    RestrictionType restriction = new RestrictionType();
    AndType andType = new AndType();
    andType.Items = new SearchExpressionType[] { lessThanOrEqualTo , isGreaterThanOrEqual };
    restriction.Item = andType;
    findItemRequest.Restriction = restriction;
    How can I modify this to give me emails older than a specific date?  Also any input on doing the deleting would also be greatly appreciated!
    Best Regards,
    Nelson

    Thank you very much Glen!  I can't believe it was that easy.  Works perfect.  I will work on the DeleteItemType.  I was also wondering if there was a way to detect if an email is an Out-of-Office (OOO) or Undeliverable message? 
    My app goes through all the emails and I need to skip any that are OOO or Undeliverable messages.  I've learned how to use the SearchFilter and I find that easier and more straight forward than setting the restrictions.  I'm also able to use a SearchFilter
    to get emails older than the specified date. 
    Here's my new code for reading unread emails using the SearchFilter and paging (for better efficiency). 
    1 - Is there anyway to tell the filter to get AllProperties without having to specify each one using ItemSchema or EmailMessageSchema?
    2- What is the difference between those two (any advantages over one or the other)?
    3 -Is there any reason to even be using the ExchangeServiceBinding here anymore since it seems the ExchangeService object is all I need?  In my old code, I was using the ExchangeService object to do an AutoDiscover and then using that to set the URL
    in the ExchangeServiceBinding.  What are the main to difference/uses for these to objects?  Sorry if that's a dumb question.
    private void GetUnReadEmails(string sMailboxName)
    // Create the binding to Exchange
    ExchangeServiceBinding esb = new ExchangeServiceBinding();
    esb.RequestServerVersionValue = new RequestServerVersion();
    //Console.WriteLine("Exchange version: " + esb.RequestServerVersionValue.Version);
    //esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
    ExchangeService service = GetBinding(sMailboxName);
    Console.WriteLine("Exchange version: " + service.RequestedServerVersion);
    esb.Url = service.Url.ToString();
    esb.Credentials = new NetworkCredential(Username, Password, Domain);
    Mailbox mb = new Mailbox(sMailboxName);
    FolderId fid1 = new FolderId(WellKnownFolderName.Inbox, mb); // where fid1 was WellKnownFolderName.Inbox
    //FindFoldersResults findResults = service.FindFolders(fid1, new FolderView(int.MaxValue));
    ItemView iv = new ItemView(50, 0);
    FindItemsResults<Item> findResults = null;
    PropertySet ivPropSet = new PropertySet(BasePropertySet.IdOnly);
    //SearchFilter ivSearchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false), new SearchFilter.ContainsSubString(ItemSchema.Subject,"MSGID:"));
    SearchFilter searchFilter = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false);
    iv.PropertySet = ivPropSet;
    do
    findResults = service.FindItems(fid1, searchFilter, iv);
    string sText = "";
    if(findResults.Items.Count > 0)
    //PropertySet itItemPropSet = new PropertySet(BasePropertySet.IdOnly) { EmailMessageSchema.Body };
    PropertySet itemPropSet = new PropertySet(BasePropertySet.IdOnly) {ItemSchema.Subject, ItemSchema.Body, ItemSchema.DateTimeReceived, ItemSchema.HasAttachments, ItemSchema.ItemClass};
    itemPropSet.RequestedBodyType = BodyType.Text;
    service.LoadPropertiesForItems(findResults.Items, itemPropSet);
    //service.LoadPropertiesForItems(findResults.Items, itItemPropSet);
    //service.LoadPropertiesForItems(findResults, new PropertySet(ItemSchema.Subject, ItemSchema.Body, ItemSchema.DateTimeReceived));
    Console.WriteLine("Total items: " + findResults.TotalCount);
    foreach (Item item in findResults.Items)
    Console.WriteLine("ItemID: " + item.Id.UniqueId);
    Console.WriteLine("Subject: " + item.Subject);
    Console.WriteLine("Received date: " + item.DateTimeReceived);
    Console.WriteLine("Body: " + item.Body);
    Console.WriteLine("Has attachments: " + item.HasAttachments);
    //Mark the email as read
    EmailMessage emEmail = EmailMessage.Bind(service, item.Id);
    //emEmail.Load();
    emEmail.IsRead = true;
    emEmail.Update(ConflictResolutionMode.AlwaysOverwrite);
    sText += "Subject: " + (item.Subject.Trim()) + " ";
    //sText += "DisplayTo: " + (item.DisplayTo.Trim()) + " ";
    sText += "DateTimeReceived: " + (item.DateTimeReceived.ToString()) + " ";
    sText += "ItemClass: " + (item.ItemClass.Trim()) + " ";
    sText += "\r\n";
    else
    sText = "No unread emails";
    Console.WriteLine("No unread emails");
    txtItems.Text = sText;
    iv.Offset += findResults.Items.Count;
    } while (findResults.MoreAvailable == true);
    Thanks again for your time.  I appreciate it.
    Nelson

  • ABAP Get Week Number for a Given Date.

    Hi All,
    I want to calculate week number for given date.
    SAP has provided function modules like DATE_GET_WEEK.. Etc are giving week number. taking default start day as Monday. But for my requirement is calculate week number based on start day as Sunday.
    Please let me know if we have any custom logic ??
    Thanks & Regards
    Vasu Yadav

    Hi Vasu,
    SAP standard functionality takes MONDAY as first day.
    But if you want then you can change it to SUNDAY by implementing BADI CALENDAR_DEFINITION. Create a new implementation for method IF_CALENDAR_DEFINITION~GET_FIRST_DAY_OF_WEEK and assign value as SUNDAY.
    Hope it solves your problem.
    Thanks
    Saurabh Kabra

  • How can I get Mail later than Mail 3.6?

    I use Snow Leopard.  When I check Mail i get an error message:  You can't use this version of the application Mail with this version of Mac OS X.  You have Mail 3.6.  I installed Snow Leopard and thought that would include later versions of Mail.  How do I get updte versions of Mail?

    Open it directly from the Applications folder. If you already are, use Pacifist to extract it from the Mac OS X 10.6 install disk.
    (66904)

  • Get week number for any given date

    How to get a week number in Java?

    / ====================================================
    Method: Get the desired Date format for the date
    Developed By: Sandip Waghole [29-Jan-2010]
    ==================================================== /
    public String getWeekNo(String strDate)
    // input Date Format : M/dd/yyyy
    int weekNo=0,i=0;
    String strWeekNo=null;
    int noOfDaysInTheYear=365;
    int WEEK_STARTS_ON = 1; // Define the day on which week starts Sunday/Monday 1:Sunday 2:Monday
    int firstDayNoInFirstWeekOfPresentYear=0; // Inititalize teh day on which week is starting in present year
    int firstDayOfPresentYear=0; // Inititlize the 1st day of the present year whether Sunday/Monday/.....
    int[] monthDaysArray = {31,28,31,30,31,30,31,31,30,31,30,31}; // Define array of the days as per months
    int todaysDayNoInPresentYear=0;
    int daysLateByFirstWeekStartedAfterYearStarted=0;
    int intTemp=0;
    //strDate="08/24/2000"; // For test purpose
    StringTokenizer strDateTok = new StringTokenizer(strDate, "/ ");
    int month = Integer.parseInt(strDateTok.nextToken());
    int day= Integer.parseInt(strDateTok.nextToken());
    int year = Integer.parseInt(strDateTok.nextToken());
    GregorianCalendar cal = new GregorianCalendar();
    // Check if present year is leap year
    boolean boolIsLeapYear = cal.isLeapYear(year);
    // If it is boolean year then add 1 to total days in the year & add one more day to february
    if(boolIsLeapYear)
    noOfDaysInTheYear=noOfDaysInTheYear+1;
    monthDaysArray[1]=monthDaysArray[1]1;
    // Find the 1st day of this year
    Calendar calObj = new GregorianCalendar(year, Calendar.JANUARY, 1);
    firstDayOfPresentYear = calObj.get(Calendar.DAY_OF_WEEK);
    int intRemoveNoOfDaysFromWeek=0;
    // # Find the day no of prsent day
    for(i=0;i<month;i+) // get no of days till present year
    intTemp = intTemp monthDaysArray;
    todaysDayNoInPresentYear = intTemp - (monthDaysArray[month-1]-day);
    if(firstDayOfPresentYear==6 || firstDayOfPresentYear==7) // If first Day is Friday or Saturday then it is week
    // Identify the the day no on which 1st week of present year is starting
    firstDayNoInFirstWeekOfPresentYear = 7 - firstDayOfPresentYear WEEK_STARTS_ON 1;
    // Find delay in the 1st week start after r=the year start
    daysLateByFirstWeekStartedAfterYearStarted = firstDayNoInFirstWeekOfPresentYear - 1;
    // Now week is starting from Sunday
    weekNo = (Integer)((todaysDayNoInPresentYear-daysLateByFirstWeekStartedAfterYearStarted)/7);
    // Find the day no of today
    intTemp = (todaysDayNoInPresentYear-daysLateByFirstWeekStartedAfterYearStarted) % 7;
    if(intTemp > 0)
    weekNo=weekNo+1;
    else
    weekNo=weekNo;
    else
    // 1st week is starting on 1st Of January
    firstDayNoInFirstWeekOfPresentYear=firstDayOfPresentYear;
    // Remove no. of days from the 1st week as week is starting from odd Sunday/Monday/Tuesday/Wednesday/Thursday
    intRemoveNoOfDaysFromWeek = 7-firstDayOfPresentYear 1; // 1 added as include start day also
    // So one week will be added in no. of weeks
    weekNo = (Integer)((todaysDayNoInPresentYear-intRemoveNoOfDaysFromWeek)/7);
    // Find the day no of today
    intTemp = (todaysDayNoInPresentYear-intRemoveNoOfDaysFromWeek) % 7;
    weekNo = weekNo +1; // As 1st weeks days are reduced from the todays day no in the year
    if(intTemp > 0)
    weekNo=weekNo+1;
    else
    weekNo=weekNo;
    // Remove the no. of days from the week 1
    strWeekNo=Integer.toString(weekNo);
    return strWeekNo;
    // Any issues please mail on [email protected]

  • Requested end date must be later than requested start date in Service Request

    Hello Experts
                          I am getting this error in the service request when the date displayed in UI is
    Requested start date-06.05.2014
    Requested End-08.05.2014
    I have searched this error in the SCN, many people  have posted this error . I have not got any satisfactory answer in the posts. I am attaching screenshot in the post.
    I am configuring the service request.Please reply as its urgent
    Thanks all of experts in advance

    Hello Ashik
    I am facing a new problem please help
    I am currently working on service request.I am facing a problem in the date management there.In my service request i have 5 statuses .One of my status is "Pending with consumer".I am using duration settings of service request.By duration settings , i am calculating the duration for which its pending with consumer.I am having 2 response profile one is 24*7 and other is having 9 working hours.In the service request from the SLA configuration i am calculating the escalation date & Time .I need to add the pending with consumer duration with the escalation date and time.I am facing a problem , i am explaining whole problem ..
    Let say if the pending with consumer duration is  1440 minutes(that is 24 hours) .I am adding the minutes to the escalation date through the date rule.
    I am facing problem that if the service profile is 24*7 then there is no problem but if it is having the 9 hours working service profile then after adding the minutes to it the escalation date is changing to 4 days ahead which is wrong.
    I need to add only those minutes for which it is pending with consumer in working hours for the 9 hours service profile
    I need to dynamically determine the working hours from the duration then add it to escalation dates when the status is changed from pending with consumer.
    Please suggest a badi will work or how to do it.Its urgent as i need to give demo.I will appreciate a quick reply.Please reply

  • Comparing dates (Start date should not be later than End date etc ...)

    Hello All,
      I have a table (5 rows) with 7 columns. Of which the first to columns are the start date and the end date. Can someone kindly advise on how I can go about to ensure that there is some validation mechanism in place such that the start date is not later than the end date and vice versa ? Thank you very much.
    from
    Kwok Wei

    Hi
      Use calculated attributes as Pran suggested. It should work. Where are you getting the data from. Is it from R/3. The node bound to the table ui element is it a model node. Anyway Here is the link on how to use the calculated attribute.
    http://help.sap.com/saphelp_nw04/helpdata/en/7f/a0384162316532e10000000a1550b0/frameset.htm
    regards
    ravi

  • I have managed to sync my iPhone 4 to my btyahoo calendar with caldav.  All entries appear on the phone calendar on the correct date, but the time given is always 5 hours later than the (correct) time on the computer. How can I rectify this?

    Why do the times for each event or appointment appear on the phone calendar exactly 5 hours later than the correct times entered into the Yahoo calendar on my P.C?  Is there a way of rectifying this, either on the Yahoo calendar site, or on the iPhone?

    You got the new iphone?????   I have same problem.  I transferred audiobooks to device to find no audiobooks on device (despite it being in iTunes as if it was).  Have you found a solution?????   I even tried to change import settings on format transfer but hasn't worked. 

  • Camel Query : Calender list : Get Items agains given date that must be greater than and eqaul to start date and greater less than or equal to end date ?

    Camel Query : Calender list : Get Items agains given date that must be greater than and eqaul to start date and greater less than or equal to end date ?
    A Snap of Employee holiday list
    Case : Anne juul Sondergaar is on leave from 05-06-2014 to 07-06-2014
    I need a query to check wheither Anne juul is on leave at 06-06-2014 ????
    I am using this query that return nothing
    SPQueryquery =
    newSPQuery();
                                query.Query =
    @"<Where>
    <And>
    <And>
    <Leq>
    <FieldRef Name='Til' />
    <Value Type='DateTime'>"
    + WorkingStartDate.ToString("yyyy-MM-dd")
    + @"</Value>
    </Leq>
    <Geq>
    <FieldRef Name='Fra' />
    <Value Type='DateTime'>"
    + WorkingStartDate.ToString("yyyy-MM-dd")
    + @"</Value>
    </Geq>
    </And>
    <Eq>
    <FieldRef Name='Medarbejdere' />
    <Value Type='Lookup'>"
    + EmployeeName.Trim() +
    @"</Value>
    </Eq>
    </And>
    </Where>"
                                query.ViewFields =
    " <FieldRef Name='ID' />";
    Ahsan Ranjha

    Hello,
    Download CAML query builder from below location and use it to build your query:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/f7b36ebc-6142-404a-8b04-9c87de272871/where-can-i-download-the-u2u-caml-query-builder-for-sharepoint-2010may-i-know-the-exact-link?forum=sharepointgeneralprevious
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for