Formula for compare two date fields

Please help me,
There are two date fields in DSO , I want to create a key figure by Query Designer, the condition as blow
Count ( If field DateA > field DateB = 1 else 0 ).

http://www.sd-solutions.com/SAP-HCM-BW-Replacement-Path-Variables.html
create 2 formula varaibles like above and comapre it

Similar Messages

  • How to Compare two Dates in java

    How to Compare two Date Field after getting the values from jTextField1.getText() and jTextField2.getText().

    Date d1=DateFormat.getDateInstance().parse(yourstring1);
    same for d2
    d1.compareTo(d2);
    could be that i misrememberd the exact naems of some functions or mixed up something in the equence of d1=

  • Java 1.3 comparing two dates using Calendar.before(Calendar)

    Has anyone used the Calendar.before() method for comparing two dates, how accurate is this?
    Some users have found problem with this method, is this true?

    manjit84 wrote:
    Has anyone used the Calendar.before() method for comparing two dates, Yes.
    how accurate is this?I've never noticed a problem.
    Some users have found problem with this method, is this true?Check the bug database^1^?
    ^1^ http://bugs.sun.com/

  • Formula for comparing dates and display data

    I have 3 objects on my query: Date, Product name and Quantity sold
    I have a table on my reports showing the top 3 products by quantity sold, and I want to add the quantity sold today on the same table.
    I am looking for a formula that compares de dates provided by the query with current date and only displays on the cell the quantity for the current day.
    Any ideas are welcome!

    As per my understanding, you want to display the today's sale of the product while the ranking is aaplied on the total quantity
    sold.
    You can create a new variable with either of the following two definitions:
    Today's Date = CurrentDate()
    Today's Sale = Sum([Quantity Sold]) where ([Date]=[Today's Date])
    or
    Today's Sale = If(([Date]=[Today's Date]) Then Sum([Quantity Sold])
    Note: The two date formats should be same.
    For getting the top three products you can use the hidden column(font, border and background white) and apply the ranking on
    the total sale coming from the DB.
    Regards,
    Rohit

  • Compare two dates in a report

    Hi,
    I would like to compare two dates on a report.
    I would like to compare the opportunity created date and the opportunity modified date. I can't use this formula CASE WHEN Opportunity."Last Modified" = Opportunity."Created Date" then 1 else 0
    I think I have to use TIMESTAMPDIFF but I don't know which interval I have to put to analyze the entire date in this format 31/12/1999 16:49:08
    Thanks a lot for your help
    Regards,

    Hi !
    It depends on the interval you need to compare these dates. If you want to know the number of days between these dates, you'll have to use SQL_TSI_DAY as interval. If it's minutes, you'll need SQL_TSI_MINUTE...
    Here are the possible intervals :
    *SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, or
    SQL_TSI_YEAR*
    Hope this will help, feel free to ask more !
    Max

  • How can I compare two summary field in cross-tab?

    <p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab?  I have following cross-table:</p><p>Type          Sector1     Sector2    Sector3       Total </p><p>Outlook         10            11           9              30         </p><p>Target            5              3           1               9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>

    Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
    1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
    2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
    For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
    Best,
    Alexander

  • Comparing two data records of same IDOC

    Hi,
    In PI, we need to compare two data records of same IDOC to figure out if what type change occurred.  For example, BENFIT3 IDOC contains data records tilted "E1BEN04".  When there are multiple "E1BEN04" data records, then we need to compare the data inside them to see whether name, or data of birth or SSN is changed. 
    Has anybody came across this before. Your help is much appreciated.
    Thanks
    -Teja

    If it is very few fields then you could use graphical mapping to determine the changes.

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • Compare two Dates

    I am familiar with Spry validation widgets but not exactly an
    advanced user. Is the following possible?
    I have two date fields on a form which specify a date range
    (dateFrom & dateTo). Is there a way to validate them to ensure
    that dateTo > dateFrom?
    I also need to use the date format: dd/mm/yyyy.
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by J:
    I have user to input a date. How can I compare user's input with sysdate(today's date)? I tried GREATEST function, moths_between(...). both not acceptable. Please advise.
    Thank you!<HR></BLOCKQUOTE>
    take user input in a variable and compare with sysdate,
    ex
    sysdate=&date or convert date into user input format
    null

  • Compare Two Date - Very Urgent

    hi to all,
    i want to compare two date..
    i m getting one date from database and having current date..
    what my issue is i want to dispaly error message when database date greater
    than current date value..
    pls help to my problem...

    import java.util.*;
    public class DateVlid {
         public static void main(String[] args)throws ParseException {
              Calendar currentDate=Calendar.getInstance();
              Calendar dbDate=Calendar.getInstance();
              dbDate.set(2007,12,10);
              boolean b=currentDate.before(dbDate);
              if(b){
                   System.out.println("it is before date");
    }Try it once for a while.
    If it has any problems let me know.

  • How to compare two dates to know which one is greater than oher?

    how to compare two dates to know which one is greater than oher?
    Please search before asking basic questions.
    Edited by: Rob Burbank on Mar 27, 2009 9:26 AM

    Hi,
    If thse to date fields are of same type u can directly compare like this.
    regards,
    Bharat.

  • Comparing two dates in a report

    Hello,
    I am attempting to compare two dates in a report in order to format a column. My code for that portion of the report is as follows:
    CASE
       WHEN TO_DATE(DATE_DUE,'DD-MON-YYYY') -
            TO_DATE(sysdate,'DD-MON-YYYY') <= 5 THEN
              '<span class="due">'||DATE_DUE||'</span>'
       ELSE
          DATE_DUE
    END AS DATE_DUE,I'm getting the error message ORA-00932: inconsistent datatypes: expected CHAR got DATE.
    I've been trying to fix the condition to get rid of the error with no success.
    Thanks
    -Brian

    One thing I just noticed that may or may not be the problem is that your case statement is returning two different datatypes depending on the condition. In one part, it is returning a character string of the span tags concatenated with the due_date (which in and of itself are incompatible datatypes) and the second part is returning just a date.
    Again, not sure if the SQL engine will do automatic conversions for you, but this seems to jive with your "char vs. date" error.

  • Comparing two dates+times [bash]

    To compare two dates+times* in bash I have always used date +%s and compared the resulting strings.  Is there a better way to do it?  Thanks.
    * As in "is date+time Y after date+time X?"

    Years ago I wrote a bash script to build a thumbnail gallery webpage for a local directory structure of torrents.  For each torrent, it created the thumbnail of an image with the same name, scraped torrents to get seeders/leechers, parsed a text file of urls and added links below the image with special favicons for commonly linked sites.
    That was a hassle, and I have been afraid to look at the script since I stopped using it.  But the page it produced was pretty sweet.
    Most of the scripts I write are a bit more down-to-earth than that though.
    Last edited by alphaniner (2012-04-25 18:50:02)

  • Table for Valid To date field in C203 Tcode

    Let me know the table name for "Valid To Date" field in C203 transaction.
    Thanks,
    Angavai.E

    Hi Angavai,
    Check with table PLMW.
    Regards,
    Raghu

  • I need to pass value for Actual GI date field in VL01N t code, I am using BAPI_DELIVERYPROCESSING_EXEC. can any one tell me how can i pass vaule ?

    I need to pass value for Actual GI date field in VL01N t code, I am using BAPI_DELIVERYPROCESSING_EXEC. can any one tell me how can i pass vaule ?

    Hi Abdul,
    Sorry for my unprecise answer, but you talk about a tcode, but you're using a BAPI Call. Maybe you want to call the transaction in batch mode?
    http://help.sap.com/saphelp_erp60_sp/helpdata/de/fa/09715a543b11d1898e0000e8322d00/content.htm
    Regards,
    Franz

Maybe you are looking for

  • Formatting report in excel format

    Hi, I have to generate report in excel format but I don't know how to format it for example to add a dynamic title, and to add a logo in the top of the excel sheet... any help.. thanks in advance.

  • Limited subject characters count when creating a new thread in Portal 7.3 forums

    Hello, i was wondering if and how you can change the max. characters for the subject when creating a new thread in Portal 7.3 forums. It seems like the character count is limited to 75 characters for subjects. I didn't find any suitable property, in

  • My lightning connector is all twisted at the ends.

    I didn't think I was twisting or kinking the cord when I used it, but I guess I must have been, and I'm being more careful now.  But what can I do to fix this cord?  Or is it okay?  It looks the same at the USB end.  I don't know if this is related,

  • How cani convert WBS report form one CAN$ to USD

    hi frnds I want to convert WBS element(Actual/plan/variance) report from CAN$ to USD. Can you please guid me how an i do this? Thanks

  • Invoice on wrong PO - how to void from FI

    Hello, My problem is that we have  invoice which was vouchered on the wrong PO and now weu2019re trying to reverse it and voucher it on the correct PO and repost a manual payment. Just not sure if once we reverse the clearing document, we can void th