Function to compare tow dates and set the value

Hi All,
 I have two dates with close date and Due date.And i want to set the value as 1 if close date is less then or equal to to due date else 0 .And my other condition is to set  1 when close date is greater the due date.Can any one help me how can I
achieve it.
Thanks, Sid

Hello Sid,
For this you can use a simple IF Statement with a compare on the Dates:
= If(Tabelle1[CloseDate] <= Tabelle1[DueDate]; 1; 0)
= IF(Tabelle1[CloseDate] > Tabelle1[DueDate]; 1; 0)
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • Loading a file and setting the values in a Jtextfield

    Hi all,
    I've created a save and open menu option for my application. The save option works as it writes to file using jFileChooser. However when using the open file option the program opens the correct file and stores the strings read into a string variable, however when I go to set the value stored in the variable to a specific textfield using settext method, it doesn't do anything. Please can someone give me some suggestions on what I am doing wrong. The following is the code snippet that accesses the file and reads from it:
    try
    int result = jFileChooser1.showOpenDialog(this);
    if ( result == JFileChooser.APPROVE_OPTION )
    String str1 = jFileChooser1.getCurrentDirectory() +
    System.getProperty("file.separator") + jFileChooser1.getSelectedFile().getName() ;
    FileReader f = new FileReader( str1 );
    BufferedReader b = new BufferedReader(f);
    while((text1 = b.readLine()) != null)
    //text2 = b.readLine();
    jTextArea1.append("\ntext1: "+text1+"\nsize: "+size);
    if(text1 == "// System Configuration")
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jSampleRate.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jFrequency.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jVoltage.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    text2 = text1;
    jFSVoltage1.setText(text1);
    /*if((text = b.readLine()) == "// Phase Selection")
    // READ INFORMATION LOOKING FOE THE SPECIFIC TAGS
    b.close();
    jFileChooser1.cancelSelection();
    Any suggestions wpould be very much appreciated. Thanks in advance.

    this is the result from the read in information:
    text1 is the string variable that is used to store the information read in from the file, while size is the variable used to obtian the size of the string. Does the readline() method have any properties which would affect what is being read in?
    text1: |=========================================================================================
    size: 0
    text1: | File Name: C:\CsoundTest\walid3
    size: 0
    text1: | Last Modified: 30-01-2003 11:25:11
    size: 0
    text1: | Warning: Do not modify the information stored in this file. If modified the inforamtion
    size: 0
    text1: | may not be retrieved correctly when loading the file into the main program.
    size: 0
    text1: |==========================================================================================
    size: 0
    text1:
    size: 0
    text1: // System Configuration
    size: 0
    text1: 500
    size: 0
    text1: 50
    size: 0
    text1: 230
    size: 0
    text1: 300
    size: 0
    text1:
    size: 0
    text1: // Phase Selection
    size: 0
    text1: 1VIncN
    size: 0
    text1:
    size: 0
    text1: // Duration
    size: 0
    text1: 0
    size: 0
    text1: 00
    size: 0
    text1: 00
    size: 0
    text1:
    size: 0
    text1: // Disturbances
    size: 0
    text1:
    size: 0
    Regards
    walidr

  • Howto: comparing 2 dates and getting the seconds

    By comparing 2 dates I need to extract or get somehow the elapsed seconds. I need to get only
    the seconds.
    Dates are in this format "hh:mm:ss"
    I tried with Date and GregorianCalendar but I couldnt get the desired result.
    Can someone provide me with a sample code please.

    remus.dragos wrote:
    Its not broken, nor absurd or complicated. I only need resolution only for minutes. The method that I use does not need to know more than 20 seconds.
    But I added minutes knoledge aniway. As you can see its easy to add hour resolution if needed. But I didnt needed it so thats why I took that approach.
    This looks cleaner for you? I just wrote it here, untested, but should work.
    public int returnSeconds(Calendar c1, Calendar c2)
    int mins =  c1.get(Calendar.MINUTES) - c2.get(Calendar.MINUTES);
    int secs =  c1.get(Calendar.SECONDS) - c2.get(Calendar.SECONDS);
    if (mins > 0) return secs+=mins;
    else            return secs;
    }And why should I treat all the time as miliseconds since the epoch. Thats an absurd afirmation without a detailed explanation.
    Edited by: remus.dragos on Apr 30, 2008 6:18 AM- Unnecessary creation of expensive Calendar objects.
    - Significantly slower
    - Breaks across Timezones
    - Unnecessary decision making introduces complexity
    - Introduces a bug by assuming c1 represents a time greater than c2
    - Introduces a bug by not multiplying minutes by 60 to obtain seconds.
    - Makes assumptions about the calendar system in use
    - Less maintainable because it limits the scope of time unit resolution handled by the logic
    I probably missed some more too. None of this is needed, and it is very brittle. Your problem can be solved by subtracting one fixed-point number from another. Go with es5f's approach.

  • Getting value from Function stored in a schema and Watching the value of objects

    hi
    i'd like to display a labelA which is from a query -> (SELECT NAME FROM TABLE1 WHERE NAME = GetA). GetA is a function which I created in SchemaA. GetA returns a varchar2. In this case.. how can i do that ?
    should i write the PL/SQL in the format trigger of this labelA ? if yes, then what should i write in the PL/SQL format trigger ? or should i create another query in Data Model ?
    And how do get hold of this labelA's value(or the result returned by the query) in the parameter form?
    And lastly is there a way to trace the value of some report objects ?
    should i use SRW.MESSAGE ? to print out the 'watched' value ? or any other alternatives ?
    what is the url that takes me to learn all these ?
    I got this error "REP-1401: 'beforepform': Fatal PL/SQL error occurred." when i initialize the bind variable to a function (GetA)stored in Schema A ---> :P_A := GetA in the before_parameter_form of report trigger;
    anything wrong with the above assignment ?
    are there any difference between stored procedure like function, package in the database and those in in PL/SQL Library of report builder ???
    null

    hi
    i'd like to display a labelA which is from a query -> (SELECT NAME FROM TABLE1 WHERE NAME = GetA). GetA is a function which I created in SchemaA. GetA returns a varchar2. In this case.. how can i do that ?
    should i write the PL/SQL in the format trigger of this labelA ? if yes, then what should i write in the PL/SQL format trigger ? or should i create another query in Data Model ?
    And how do get hold of this labelA's value(or the result returned by the query) in the parameter form?
    And lastly is there a way to trace the value of some report objects ?
    should i use SRW.MESSAGE ? to print out the 'watched' value ? or any other alternatives ?
    what is the url that takes me to learn all these ?
    I got this error "REP-1401: 'beforepform': Fatal PL/SQL error occurred." when i initialize the bind variable to a function (GetA)stored in Schema A ---> :P_A := GetA in the before_parameter_form of report trigger;
    anything wrong with the above assignment ?
    are there any difference between stored procedure like function, package in the database and those in in PL/SQL Library of report builder ???
    null

  • Setting the values inside xml file in xmlparsing

    Hi,
    Iu2019ve an xml file without containing any values inside the tags. I need to get the values from the text file and set the values inside the xml file. When I try to set the string variable inside the setValueNode()  using DOM parser, itu2019s not setting any values inside the xml file. 
    Please help me on this..
    Regards
    Vineela

    Hi,
    I am doing conversion from EDIFACT format to xml format.
    I am writing this code using core java. So I am using xmlparsing to convert my data. Iu2019ve one Hash table with me. I need to get the values from there and populate those values into xml file.
    Regards
    Vineela

  • When attempting to format region and set date and time the busy icon appears and seems to stay like this?

    when attempting to format region and set date and time the busy icon appears and seems to stay like this?

    Click on DU's Partition tab when you have the raw drive name selected, then set it to one partition, Mac OS Extended. If it crashes or freezes, it is finding a bad block and can't write.
    In any event, if you want to use the drive, and have not zeroed it before, you should now.
    Click on Erase -> Security Options -> Zero out data. Still with the full drive selected and not any partition(s).
    Then repartition the drive if needed.
    Boot from the DVD if that doesn't work. And no, TTPro has never mapped out bad blocks let alone create partitions.
    Disk Utility in 10.4.8 is quite good, excellent in fact. No need for an alternative.
    Your eMac drive may need to touch of Disk Utility itself. FSCK from the command line, clear the caches with Applejack along with check for corrupt plists. Between Disk Utilty and Applejack (free/shareware) never had to use TechTool Pro - or at least there weren't any errors after those two got done. But if you want a good 3rd party, pick up Disk Warrior 4.

  • How to Read the one Source Column data and Display the Results

    Hi All,
         I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
    Ex:
    Pr_ProjectType
    AD,AM
    AD
    AM
    AD,AM,TS,CS.OT,TS
    AD,AM          
    like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
    4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.
    this logic we need we have thousand of data in the table.Please help this is urgent issue
    vasu

    Hi Vasu,
    Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
    are two approaches for your reference:
    Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
    for the custom function is as follows:
    CREATE FUNCTION dbo.udf_GetNumeric
    (@strAlphaNumeric VARCHAR(256))
    RETURNS VARCHAR(256)
    AS
    BEGIN
    DECLARE @intAlpha INT
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
    BEGIN
    WHILE @intAlpha > 0
    BEGIN
    SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
    END
    END
    RETURN ISNULL(@strAlphaNumeric,0)
    END
    GO
    The SQL commands used in the OLE DB Source is like:
    SELECT
    ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
    FROM MyTable
    Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
    characters to the corresponding substring. The script is as follows:
    using System.Text.RegularExpressions;
    Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
    References:
    http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/ 
    http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • Feature Request: Functions to read image data, and write to tiff or jpeg.

    Functions that render image data and make it available to plugins before writing to disk would facilitate writing plugins that take rendered image data into consideration. Also, if the aforementioned image data could be subsequently written to disk possibly after a bit of modification, it would open up a whole new world for plugins.
    Plugins don't need to access the mid-rendering stages in the raw conversion / rendering pipeline, but having a shot at post-rendered, pre-written to disk image data would allow pixel manipulating export plugins to be written. A set of image file manipulation methods would be a decent work-around, providing the ability to read/write tiff/jpeg files.
    Rob

    Well, I'm replying to my own question!
    I solved the problem by reading the data from my card, then using Flatten Pixmap to create a pixmap from my data array, then using Draw Flattened Pixmap to create a picture to send to a 2D Picture.  This works fine.
    Now, how can I change the Pixmap into Image so I can save to an AVI?

  • TRY CAST and setting the type according to destination column

    Hi,
    I am loading data from different sources. I have to do data quality checks for data I am loading into destination. For Decimal Values I have destination data types Decimal(28,2) and Decimal(28,6) 
    I would like to check the source data and covert the type according to destination column. How can I use the try cast in this scenario?
    SELECT TRY_CAST(REPLACE('100,500.000',',','') AS DECIMAL(28,2))
    this statement will convert every thing to two decimal places. but if destination column is decimal(28,6) i would like to convert it to 100500.657899
    What is the best way of doing it?
    MH

    Hi MH,
    According to your description, you need to CAST and setting the type according to destination column which data types is Decimal(28,2) and Decimal(28,6), right?
    "this statement will convert every thing to two decimal places. but if destination column is decimal(28,6) i would like to convert it to 100500.657899" If in this case, then there are different data types on the same column which is not
    supported in current version. So as per my understanding, there is no such a functionality to achieve your requirement. What we can do is convert to corresponding datatype (Decimal(28,2) or Decimal(28,6)), and then convert it to nvarchar datatype.
    CREATE TABLE #TEMP(A NVARCHAR(50))
    INSERT INTO #TEMP VALUES('1538.21'),('1635.326541'),('136.235')
    SELECT
    A,
    CASE
    WHEN (LEN(RIGHT(A,LEN(A)-PATINDEX('%.%',A))))>2
    THEN
    CAST(A AS DECIMAL(28,6))
    WHEN (LEN(RIGHT(A,LEN(A)-PATINDEX('%.%',A))))<=2
    THEN
    CAST(A AS DECIMAL(28,2))
    END AS B,
    CASE
    WHEN (LEN(RIGHT(A,LEN(A)-PATINDEX('%.%',A))))>2
    THEN
    CAST(CAST(A AS DECIMAL(28,6)) AS VARCHAR(99))
    WHEN (LEN(RIGHT(A,LEN(A)-PATINDEX('%.%',A))))<=2
    THEN
    CAST(CAST(A AS DECIMAL(28,2)) AS VARCHAR(99) )
    END AS B2
    FROM #TEMP
    DROP TABLE #TEMP
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.

    Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.
    Is there any way to re-number them in the order I have chosen so that they can then be sorted by number? The scans are all from pre-digital images that I wish to move to a photobook and I don't want to have to organise them twice!
    Thanks for any suggestions.

    I was a bit short, Chris, sorry. It is limited, what can be posted, when typing on an iPad.
    Now I am back on my Mac. I meant the following:  Batch Change the date for a large range of photos, that should have a date stepped in increments.
    Select all Photos at once and use the command "Photos > Batch Change".
    Then set the date for the first photo and select an increment, e.g. one minute.
    Now all photos will get a new date assigned, incremented by one minute, in the sequence you have selected. So you will be able to sort them by date.  This way it will be unnecessary to change the titles or filenames.

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • Function Module to find date by passign the Planning Calendar

    Hi All,
    Can you tell me is there any function Module to find date by passign the Planning Calendar?
    The requirement is i have a planning calender assigned to the Material in the MRP2 view.
    Example: Material XXXXXX is assigned a Planning Calendar Z01.
    Z01 is defined such that Delivery is on Monday only. This calendar says that the material is received from the Vendor only on Mondays.
    So whenever i punch a Sales Order for Material XXXXXX, a PR is automatically geenrated when saving the sales order and the calculation of Delivery dates is also happening at this level.
    Basing on this PR a PO is raised to a Vendor for procuring the Material XXXXXX, now my problem is for example the PO is raised today (30.04.2008), but the Materail XXXXXX is available only on next monday in my plant (05.05.2008) basing on my Planning Calendar assigned in the Materail Master, so i have to inform this dealy to my customer at the time of punching the sales order.
    So is there any function Module to find date by passign the Planning Calendar?
    Thanks for your valuable inputs.
    Regards,
    Sudarshan

    Hi Jorge,
    Thanks for your reply.
    I am unable to open the Function module which you have mentioned below.
    I am working on 4.6 c version of SAP.
    Any ways i have found one function module which is useful to my requirement as stated below:
    DATE_GET_PERIOD
    Thanks and Regards,
    Sudarshan

  • Compare two tables and log the difference

    Hi,
    I want to compare two tables and log the difference in new table with the fields as (old value,new value, column name). The column name should be the changes value column

    Can you show an example?
    SELECT Foo.*, Bar.*
       FROM Foo
            FULL OUTER JOIN
            Bar
            ON Foo.c1 = Bar.c1
               AND Foo.c2 = Bar.c2
               AND Foo.cn = Bar.cn
     WHERE Foo.key IS NULL 
        OR Bar.key IS NULL; 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Is there api function to change access mode and set a passcode to recording in meeting?

    Is there api function to change access mode and set a passcode to recording in meeting?
    When I'm trying to use "action=acl-field-update&acl-id=SCO_ID_RECORDING&field-id=meeting-passcode&value=MY_PASSC ODE" it just clean the password and do not set it or change.
    And "action=permissions-update&acl-id=SCO_ID_RECORDING&principal-id=public-access&permission- id=view-hidden" do not work too.

    There is not a specific API for doing this. This was discussed in the other Connect forum here, Adobe Connect User Community.
    For you call I would make the second part differently. Instead of 'field-id=meeting-passcode&value=MY_PASSCODE' I would call 'meeting-passcode=MY_PASSCODE' and see if that worked better.

  • Setting the value of a java variable in javascript function

    How can i set the value of a java variable in a javascript function?
    <%
    String fName = "";
    %>
    now i want to define a javascript function which can set the value of fName to the value it has been passed.
    <script language="javascript">
    function setJValue(val)
    </script>
    Thanks

    The only way you could simulate this, would be call the same page inside the Javascript function, and send it the parameter that was passed. Then you would have your Java code retrieve this parameter by request.getParameter("value");, and set the variable accordingly.

Maybe you are looking for