Date Field Greater than today?

Ok, i've been trying to figure out how to compare a date to today.  Basically i have a field which is a Valid To field.  I want to know if this is still valid by comparing it to todays date.
The idea is fairly simple.  However, it seems that comparing dates is beyond the normal query capabilities for some reason?
So i did some digging around, looking at what other people have tried.
I ended up creating a customer exit variable with the following code:
WHEN 'ZVAR_WHATEVERJUSTWORK'.
      CLEAR l_s_range.
      L_S_RANGE-SIGN    = 'I'.
      L_S_RANGE-OPT     = 'GE'.
      L_S_RANGE-LOW     = SY-DATUM.
      append L_S_RANGE to E_T_RANGE.
When i set up the variable in Bex Query Designer, i call it ZVAR_WHATEVERJUSTWORK (technical).
I set it to be a customer exit, however in the Details tab, i'm not sure what the variable represents.  i've tried single value (query short dumps) and i've tried Interval (query short dumps).  When i'm testing it, i'm restricting a DAT object to my variable.
Quite frankly, i'm amazed something so simple is as complex to set up?  I honestly believe i'm making some mistake somewhere and theres really an easy way to go. 
So i'm asking the powers that exist in the SDN forums.
Any ideas?  what am i doing wrong? Please help
If i've not provided enough info, please ask.

Bryan,
you can do it this way....
In your query you can have
Valid To Date|Formula Variable 1 | Formula Variable 2 | Formula 3
Formula Variable 1 - replacement path Valid To Date - dimension should be Time
Formula Variable 2 - Customer Exit - Sy Datum
write the exit as
WHEN 'ZVAR_WHATEVERJUSTWORK'.
      CLEAR l_s_range.
      L_S_RANGE-SIGN    = 'I'.
      L_S_RANGE-OPT     = 'EQ'.
      L_S_RANGE-LOW     = SY-DATUM.
      append L_S_RANGE to E_T_RANGE.
Formula 3 - difference between 1 and 2
here in the query you can put a condition on Formula 3 to get the desired result.
Arun

Similar Messages

  • Trying to do date field greater than a specified date in condition editor

    Hi All,
    I am trying to build the XML predicate in the expression editor to check that the posting date sent is greater than a specified date to determine the reciever. I can get it to validate posting date is = to specified date, but when I change the = to > it fails to properly determine the receiver, when I send a valid document.
    Below is the expression build
    (/p1:ServiceAcknowledgementConfirmation/ServiceAcknowledgement[CreationDateTime>'2007-02-03'] EX )
    has anyone done this type of check. I have it set as a date type for the expression.
    Regards,
    Chris

    Hey all,
    I tried >= 2007-02-04 and sent in that exact date. It failed. I removed > so that it is just = 2007-02-04 and it was successful. So, is >= an allowable operator?
    Thanks,
    Chris

  • Date is greater than current time plus 24 hours

    Hi,
    may I know how to pull data from a table where date is greater than current time (+24 hours)... my date field is in the following format 15-MAR-2013 20:07:00
    I want to do something like this
    select * from table_A where date_field > (sys_date_time) +24h
    as an example, when I run a query @ 4 PM on March 26, I want to pull data that has date > 4 PM March 27
    Thanks

    >
    may I know how to pull data from a table where date is greater than current time (+24 hours)... my date field is in the following format 15-MAR-2013 20:07:00
    >
    No - a DATE column does NOT have a value in a format like that. The value is stored in an internal binary format. The format you posted might be your NLS_DATE_FORMAT or just a format you provided to display that date value.
    >
    I want to do something like this
    select * from table_A where date_field > (sys_date_time) +24h
    as an example, when I run a query @ 4 PM on March 26, I want to pull data that has date > 4 PM March 27
    >
    As others have said to add 24 hours to whatever value SYSDATE has at the time the query is executed just use 'SYSDATE + 1'.
    But there are at least two caveats:
    1. You can't really run a query '@4 PM'. You don't have ANY control over exactly WHEN the query will begin execution. The only way to control the date used is if you provide it yourself as part of the query.
    2. Your 'date_field > SYSDATE + 1' query will NOT see inserted/updated data that has not been committed. So a similar query later may return a different result set even if it appears to cover the same time period. In other words you can't reliably use a DATE column like that to pull sequential sets/batchs of data unless there is no DML occuring on the data that might affect the results.

  • Maintaine error message if posting date is greater than Sch del date in PO

    I have maintained a delivery schedule in a PO for a material
    Say PO qty 100
    Del Schedule
    10.04.09  - 60
    20.04.09 - 40
    While GRN, for 60 qty, if posting date is greater than 10.04.09, system needs to throw error.
    I want to do it for selected materials only.
    Is there a way to do this.
    Regards,
    Rakesh

    Thanx for reply
    If I use OMCQ message , it will be applicable for all GRNs and I want for a particular set of materials.
    Can one please suggest User exits / BADi for the same. I have checkd BADIs but those are based upon MSEG and EKBE table.. and i dont have any material doc no before posting the document.
    requiement is to check the delivery sch date and posting date befor posting the document is posted.
    Any suggestions welcomed.
    Reagrds,
    rakesh

  • GR posting date always greater than PO document date.

    Dear SAP Gurus,
    Am working on below requirement in a support project..
    Need to ensure GR posting date always greater than in PO creation date. Only current month is open for GR posting and at present as a standard system allows to post GR any date in the current open period.
    Is there any way, we can control the same via messages without implementing any exits or badis.
    Appreciate immediate response.
    Regards,
    GM

    there is no std sap for this
    you can use user exit to ful fill ur requirement
    in that u can write a code where is u can check all PO dated in GR must be eq to or less than GR posting and document date
    hope this helps

  • Doc Date is Greater than Posting Date in Migo

    Hi ,
    Document  Date shouldn't be greater than Posting date in MIGO .How can I restrict it ??
    Biswajit

    Hi
    We can restrict through Define Attributes of system messages
    Settings for SYSTEM MESSAGES  - Doc Date is Greater than Posting Date in Migo in that  in that Message Type we can make the Warning Message to Error Message
    regards,
    senthil.

  • Count statement for fields greater than 10 characters

    Hi,
    I am trying to write a query to select results from a database table where the results are only fields greater than 10 characters in length.
    e.g.
    Table
    Employee----
    Andrew
    Jennifer Smith
    Jamal
    the query would only show the result Jennifer Smith because this field exceeds 10 characters in length.
    Any help is appreciated....

    Have you tried coding anything yet for this homework assignment?
    HINT: Use the LENGTH() function.

  • From Date is greater than End Date of a BBP document.

    Hi,
    There is a BBP document created in the system which has From Date (BBP Start Date) greater than End BBP Date.
    Have any one come across this type of issue.
    Can any one tell what can be the reasons for this to happen?
    Also in this case there are no entries for the items in this BBP document in database table DFKKMOP.
    Thanks in advance,
    Hrushikesh

    Hi Hrushikesh,
    Could you please check the details at billing document level if any of them is having the bad data.
    Also, please check the data passed and the importing data for the below FM's in debug mode.
    1. START_TIME_DETERMINE
    2. END_TIME_DETERMINE
    I am not sure, but have heard about the similar issue in one of the project, but it was related with invoicing not specific to BBP.
    Let me know the data received for the above FM's, also, will check if I can get any specific details for the same.
    Regards,
    Rajesh Popat

  • Detection method - date modified-greater than issue

    Hi,
    My detection method for a file doesn't seem to be working properly. I have an application advertised to run a .cmd file and replace files in an already existing folder. So I am using the date modified of the files I am replacing. When I check the status
    of the deployment it states that the machines are already compliant even though the date modified on the file is less than the new file I am trying to deploy.
    Example:
    C:\ProgramData\Microsoft\Network\Connections\Cm\Test\test.cms (date modified 9/14/2014)
    My detection rule:
    C:\ProgramData\Microsoft\Network\Connections\Cm\Test\test.cms (Date Modified must be greater than 01.01.2015 00:00:00)
    And it is stating that it is compliant even though the detection rule should be returning false?

    Date format is seems to be correct, basically it depend on your local date format.
    Are you sure that file is exist on the client at expected location. (If file does not exist and existential rule is not added in CI then CI will return to Compliant) If not then make sure that:
    you have added existential rule in addition with value rule.
    otherwise make sure that you have selected this checkbox "Report noncompliance if this setting instance is not found."
    This posting is provided "AS IS", provides no warranties, and confers no rights. -Praveen S.

  • Select records with a date greater than today

    Hi,
    I have a table that lists leases, and each lease has an expiration date (stored in three fields; EXPYR, EXPMN, EXPDA).
    I want to create a report that selects just those records that have an expiration date later than the date when the report is run.
    Any ideas?

    Jon,
    I'm assuming that the 3 fields are Year, Month & Day...
    Create a formula...
    Date(EXPYR, EXPMN, EXPDA)
    Then, for your record selection, create the following formula...
    {@DateFormula} > CurrentDate
    HTH,
    Jason

  • How can I set the java Date not greater than the day inputed?

    When I would input the date, I don't want it to be after this day because it would violate some business logic in my program. I am allowed to input date latter than this day like yesterday, last week etc. but not after this day.....Can anyone give me a concrete example or logic on how to do this?THANKS!

    tr3k wrote:
    Can you explain it by code?I could, but I won't. I pointed you in the right direction. Now it's up to you to make the effort. Give it your best shot and post a more detailed question if you have problems.
    http://www.javaworld.com/jw-12-2000/jw-1229-dates.html
    http://www.javaalmanac.com/egs/java.text/FormatDate.html
    http://www.javaalmanac.com/egs/java.text/ParseDate.html
    http://java.sun.com/javase/6/docs/api/java/util/Date.html
    http://java.sun.com/javase/6/docs/api/java/util/Calendar.html
    http://java.sun.com/javase/6/docs/api/java/util/GregorianCalendar.html
    http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

  • How to get Length of Editable Field greater than 10 using ALV_GRID_DISPLAY

    Hi Experts,
    I am Using , REUSE_ALV_GRID_DISPLAY_LVC For Displaying  an ALV Report .
    Now i'm Using Few fields in Editable mode , but the problem is that , the length of those, editable fields is restricted only to 10 characteras.
    But i need a editable  field with length of 20 chars , ,for, entering some remarks..Is it possible ?
    Can anyone, help how to do that ..?
    Thanx in Advance .. 
    Regards,
    Rajesh

    you can make use of INTLEN
    set the value to 20 and then you can enter to 20 chars.
    FIELDCAT-INTLEN = 20.
    FIELDCAT-OUTPUTLEN = 20.

  • Get item Greater than and equal to today's date...

    Hi,
    We are having issue in getting item greater than today's from SharePoint List. We have a column in list with Date and Time Data type.
    I am using below code to get data greater than and equal to today's date.
    SPQuery query = new SPQuery();query.Query = "<Where><Geq><FieldRef Name='Expires' /><Value Type='DateTime'>"+ DateTime.Today.ToShortDateString() + "</Value></Geq></Where>";
    SPListItemCollection listItemCollection = list.GetItems(query);
    Please suggest what is wrong in above query.
    Regards,
    Amit Chhatbar

    Hi Amit,
    I guess the date is expected to be in UTC and ISO 8601 format. Use the below code and check if it works.
    DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ")or DateTime.Today.ToString("yyyy-MM-ddTHH:mm:ssZ")
    Ram Prasad Meenavalli | MCITP | MCTS SharePoint | MCPD SharePoint | http://www.spdeveloper.co.in

  • Need to create a workflow after Date Modified is greater than 7 days

    I'm using SharePoint Deisnger 2010 and attempting to create a workflow to generate an email after the Date Modified is greater than 7 days. Checking to see if there is a way to create this workflow without creating a "calculated" field with a date.
    Have:
    If Current Item:Modified is greater than Today
    But would like to have 7 days not today or a set date.
    What's the best way to do this?

    Hello,
    In addition to Bistech, here is link to set date in WF context variable.
    http://stackoverflow.com/questions/17082455/sharepoint-designer-2010-set-variable-today-x-days
    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

  • Hide/disable a row of a list when "date" column is less than today's date.

    Hi,
    We are using a "Finalsubmitted" date column in my list. my requirement is once that date of Finalsubmitted column is expired(less than today's date), total row should be in hide/disable mode.Could you help me to achieve this.
    Thanks.

    that is a drop down, showing the results from another list based on our selection.
    We have used SP services for that.
    But, date conversion is wrong on  var pubdate= new date(dateselected.value) line.
    It is showing "NaN(Not a number)" . date format it is giving DDMMYYYY.
    But, i need MMDDYYYY. How can we convert in JavaScript.
    Plz check below code.
    <script language="javascript" type="text/javascript">
    $(document).ready(function()
    today = new Date();
    getTagFromIdentifierAndTitle("select","Lookup","Dates").onchange = function() {ChangeEvent1()};
    function ChangeEvent1()
    var dateSelected = document.getElementById("Dropdown ID");
    var pubdate = new Date(dateSelected.value);
    if(pubdate<=today)
    $("input[value$='Save']").attr('disabled', true); //button hides
    alert("Publishing Date should be greater than Today's Date");
    else
    $("input[value$='Save']").attr('disabled', false); //button shown
    function getTagFromIdentifierAndTitle(tagName, identifier, title) {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
    return tags[i];
    return null;
    }</script>

Maybe you are looking for

  • Crystal report logon Failed Error

    Dear All We have installed BOBJ Edge 3.1 Server at Windows Server. We insalled Crystal Report 2008 at one of our Laptop.  (Client). When we tried to create a sample report, we selected a existing universe from the BOBJ Server.  When we selected it as

  • I can't get my "String.valueof()" working

    Hello, I'm trying to create a method to search a string for a char with an if statement. I have created the following but it won't compile anyone know where I'm going wrong? public String string0 = "AEHIOUWY"; public char getCode(char aChar) if (stri

  • DVD decting only orginal italian windows cd

    I have ingstalled windowsxp sp2 italian version and upgraded to sp3 by changing language in regedit language 0409 now my dvd is not accepting i have also change the reginol time and date setting and unicode settign i  have also chaged language in dvd

  • With the last update of Nightly, Firefox always crash, what can i do?

    I have Nightly 64 bits on Windows, since the last update it always crash, even if i have re-install... What can I do?

  • WEB-AS JAVA type TS not removable from SLD

    Hi Experts, I have a peculiar issue where In I have a ECC 6.0 ( SID :- RD1) added in my SLD of PI 7.0 as WEB-AS ABAP Type Technical System. I was able to work with the corresponding Business System in my ID( configuration). But two days back when I l