SSRS find max of converted date field

Hi
My SSAS source has a date field in this for mat dd/MM/yyyy which is stored as a string.
In ym report when I find the MAx of this field it is doing it by the day rather than the date.
I have tried the following but it doesn't seem to work it just errors on the report, how can I get this to work.
Thanks
=MIN(FORMAT(datevalue(Fields!DDMMYYYY.Value),"dd/MM/yyy"))
when converting say 28/10/2013 it is saying the date is not valid so I think it is trying to do mm/dd/yyyy

Hi aivoryuk,
Based on your description that you have problem by using the expression "=MIN(FORMAT(datevalue(Fields!DDMMYYYY.Value),"dd/MM/yyyy"))" to convert the string date fields "dd/MM/yyyy" to date type  "dd/MM/yyyy" and
get the minimum date ,right?
I have tested on my local environment and can reproduce the issue, the issue can be caused by the CDate("dd/MM/yyyy") function is not invalid, the CDate() function not support the format "dd/MM/yyyy", but support this format "MM/dd/yyyy",
so you can add an calculated fields which have the changed format date of "MM/dd/yyyy" first.
Details information for your reference:
Right click the DataSet(DataSet1) and select the "Add Calculated fields" to create the New fields:
Name:NewDate
Value:using this expression to get the "MM/dd/yyyy" formatted date:
=split(Fields!DDMMYYYY.Value,"/")(1)&"/"& split(Fields!DDMMYYYY.Value,"/")(0)&"/"&split(Fields!DDMMYYYY.Value,"/")(2)
Modify the current expression "=MIN(FORMAT(datevalue(Fields!DDMMYYYY.Value),"dd/MM/yyy"))"
as below:
=Format(MIN(CDate(Fields!NewDate.Value),"DataSet1"),"dd/MM/yyyy")
OR you can using this expression:
=Format(Min(DateValue(Fields!NewDate.Value),"DataSet1"),"dd/MM/yyyy")
Note: this function Min() can add an scope as needed like Min(CDate(Fields!NewDate.Value),"Scope")
Preview you will get the proper result:
If your problem still exists, please feel free to ask.
Regards
Vicky Liu
Thanks Vicky that worked a treat.
What I also did was to bring into the cube the date field as a date (yyyy-mm-dd) format and then used and then used Vikash16 suggestion that also works.
Nice to have a couple of solutions.
Regards

Similar Messages

  • Finding Gaps in the date field.

    Hello,
    I have a date field in a table which has date values incremented every month for 5 years.
    I have to find out the any gaps between the months that is the entry for some month is not there.
    eg. the data is as follows, i have entries for dec month of 2000, jan of 2001, feb of 2001, march of 2001, April month is missing, there is entry for may of 2001 and it follows.
    I want to display that April month is missing.
    How would i do in pl/sql.
    Help would be appreciated
    thanks.
    return_dt
    12/31/2000 12:00:00.000 AM
    12/31/2000 12:00:00.000 AM
    12/31/2000 12:00:00.000 AM
    12/31/2000 12:00:00.000 AM
    1/31/2001 12:00:00.000 AM
    1/31/2001 12:00:00.000 AM
    1/31/2001 12:00:00.000 AM
    1/31/2001 12:00:00.000 AM
    2/28/2001 12:00:00.000 AM
    2/28/2001 12:00:00.000 AM
    2/28/2001 12:00:00.000 AM
    2/28/2001 12:00:00.000 AM
    3/31/2001 12:00:00.000 AM
    3/31/2001 12:00:00.000 AM
    3/31/2001 12:00:00.000 AM
    3/31/2001 12:00:00.000 AM
    5/31/2001 12:00:00.000 AM
    5/31/2001 12:00:00.000 AM
    5/31/2001 12:00:00.000 AM
    5/31/2001 12:00:00.000 AM
    6/30/2001 12:00:00.000 AM
    return_dt
    6/30/2001 12:00:00.000 AM
    6/30/2001 12:00:00.000 AM
    6/30/2001 12:00:00.000 AM
    7/31/2001 12:00:00.000 AM
    7/31/2001 12:00:00.000 AM
    7/31/2001 12:00:00.000 AM
    7/31/2001 12:00:00.000 AM
    8/31/2001 12:00:00.000 AM
    8/31/2001 12:00:00.000 AM
    8/31/2001 12:00:00.000 AM
    8/31/2001 12:00:00.000 AM

    SELECT A.MISSING_MONTHS
    FROM (select DISTINCT TRUNC(B.DATES,'MON') MISSING_MONTHS
             from(select ADD_MONTHS(sysdate, (MONS_BACK*-1) ) + rownum dates
                     from dual,
                         (SELECT MONTHS_BETWEEN (TRUNC(SYSDATE,'MON'),MIN(TRUNC(RETURN_DT, 'MON')) ) MONS_BACK
                              FROM DATE_TAB)
                  connect by rownum < 1000) B ) A
    WHERE A.MISSING_MONTHS <=(SELECT MAX(TRUNC(RETURN_DT, 'MON')) FROM DATE_TAB)
      AND A.MISSING_MONTHS NOT IN (SELECT TRUNC(RETURN_DT, 'MON') FROM DATE_TAB)

  • How to find Maximum of a date field using BEx

    We are trying to just display the maximum of a date field in a BEx report along with some fixed text .
    If we need to create a formula using Maximum function , how to use the same?
    For ex, we have a field "Flight Date" in the cube and cube has been updated with flight date till 10.09.2006.
    we want to display in the BEx report something like "Flight details are available only till <maximum of the flight date field from the cube>"
    Please help.

    Srilakshmi,
    Create a formula on the data and then sort the query on the date , that way the latest date would come on top. I am not sure if you can have something the way you have described..
    an option could be :
    Have a query on the cube with a condition of top date where the date could be a formula , this way you would get the latest date. se this as a value set to filter another query that displays only the date and nothing else , have some static text beside the query to indicate that this is the latest date.
    Hope it helps..
    Arun
    Assign points if helpful

  • How to use MAX() function with date field

    Hi Frzz,
    I have created a Graphical calculation view in which i have multiple records for each employee with different dates. But my requirement is to take the records which have maximum date.
    I have converted the date into Integer and applied the MAX() function. But still am getting multiple records.
    Is there is any other way we can achieve this requirement in Graphical Calculation view??  Your suggestion will really help me.
    Thank  you.
    Krishna.

    Hmm... what have you tried out so far?
    Look, I took the effort and created a little example, just for you
    Assume we have a table that contains the logon dates of users.
    Every line contains the logon date and some info on the user.
    Very much like a not-normalized log file could look like.
    Now, the output we want is: one line per user with the most current logon time.
    Not too difficult:
    1. Have a aggregation node that gives you the distinct user details - one line for every user:
    2. Have another aggregation node that gives you the last (MAX) logon date per user:
    Finally you do a 1:1 join on the USER_ID and map the result to the output.
    Easy as pie
    - Lars

  • Finding text in a data field

    Hi, How could I find the % character in a string? I need its position in the string. The string is a field of a table.

    Hi Jacob,
    here a short example with char and string.
    DATA: ST TYPE STRING.
    DATA: CH(250).
    START-OF-SELECTION.
      ST = 'I am a String with an % Character'.
      SEARCH ST FOR '%'.
      WRITE: / SY-SUBRC, sy-fdpos.
      CH = 'I am a Char with an % Character'.
      SEARCH CH FOR '%'.
      WRITE: / SY-SUBRC, sy-fdpos.
    Regards, Dieter

  • Reg Data fields in DSO

    Hello SAP Guru's!!!!
    I have some doubt on maximum number of data fields in DSO. I gone through so many threads on SCN, but could not clarify my doubt.
    The max no of key fields in DSO is -- 16
    Max no of data fields in DSO is --749.
    But i read in some of the scn documents  a table can have maximum 256 columns .
    DSO is also like a two dimensional table which can also have the same properties of a two dimensional table.
    if the above statement of mine is correct.. the number of columns in a DSO is 256 columns = 16(primary key)+240 (data fields--non key fields)
    but how come 749 data fields (max) will be there ? if it is so ... the max no of  fields will be  749+16 = 765.
    I need some clarification on this ....
    Awaiting for your responses!!!!
    regards,
    vamshi

    Hi Rajavamshi,
    For DSO:
    1. See for Standard DSO we have Key fields & Data Fields will be there
    2. Key Fields will store only Characterisitc Info Objects, maximum no.of characteristic info object we can add here was 16
    3. But in Data fields we can add both Characterstics & Keyfigure infoobjects, Max of 749 data fields we can add here.
    4. Atleast one field should be there in either Key fields & Data fields.
    For InfoCube :
    1. Info cube structure will be having the 16 Dimensions and the Key Fields.
    2. In that 16 Dimensions 13 User defined and the 3 pre defined dimensions.
    3. One user defined Dimension will maximum can hold 248 Characteristics Info Object, not the Keyfigure Info Object here.
    4. But the Key Fields here will store maximum will hold 233 Key Figure Info Object.
    Thanks..!!
    Regards,
    Harish. K

  • Convert date to number

    Hello.
    I want to convert date field to number. I used TIMESTAMPDIFF(SQL_TSI_DAY, "Invoice date (invoice header)".Date, CURRENT_DATE ) to get number of days from invoice date to current day but this number is treated as date format and I'm not able to make calculation on that number. Any suggestions how to convert this »number« to real number that also calculation would be possible.
    Thank you.
    Brgds, Luka

    Any hint or is not possible as Kishore said....
    I would like to sum (grand total) all the days that I get from TIMESTAMPDIFF.
    Example:
    Invoice nr. Due date TIMESTAMPDIFF(SQL_TSI_DAY, "Invoice due.date (invoice header)".Date, CURRENT_DATE )
    201001006978          30.11.2010     44
    201001007250          8.12.2010     36
    201001007392          15.12.2010     29
    201001007735          23.12.2010     21
    201001007815          30.12.2010     14
    SUM = 144
    Brgds,
    L

  • Finding difference between Max date and Min date from single date field

    Dear Experts,
    Here I am with a scenario where i didnt find any solution in SDN and in most threads it is unanswered.
    I have 1 KF which is a date field. With reference to Serial no, I want to find out the Max and Min date from the same KF. I created 2 CKF where the same KF is used in both CKF to find the Min and Max dates,
    Ex:
    Serial No | Material | Actual Del date | Max | Min | Difference
    0123 | 300012 | 01.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300013 | 07.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300018 | 15.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300014 | 30.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0124 | 300019 | 02.01.2009 | 10.01.2009 | 02.01.2009 | 8
    0124 | 300012 | 06.01.2009 | 10.01.2009 | 02.01.2009 | 8
    0124 | 300017 | 10.01.2009 | 10.01.2009 | 02.01.2009 | 8
    This is the way how I want the output where now I am able to get the values right till Max and Min and not the difference. I even created the 3rd CKF the find the difference but it is not working.
    How can I find the difference between the Max and Min dates?
    Regards,
    Chan

    Hi
    You have FM --DAYS_BETWEEN_TWO_DATES you can use this while Customer Exit.
    Try to Have 2 RKF for Min Data and Max Date and create a formula/CKF on the same ..
    Hope it helps

  • MS Excel automatically converts numeric fields to date format

    I have at least 2 different spreadsheets where this happens.  I maintain them for months, adding, changing, deleting data.  They contain lots of data elements (numeric, text, date, etc).   Some columns are all numeric, some all dates,
    etc.  Then suddenly when I open the spreadsheet, my numeric formatted data has been converted to date format.  I see lots of # signs in cells, which is an indication that this happened, and selecting an affected cell shows a date, generally in the
    early 1900s, depending on the original numeric value that was in the cell.  I convert the fields back to numeric, but sometime later the same problem occurs -- numeric fields are now date formatted.  I cannot identfy any specific change that I make
    that would cause this.  And I only recognize it as having occurred when I open the spreadsheet, not anytime during its maintenance.  I am using MS Excel 2007 SP2 in a Windows XP SP3 environment.  The machine is well maintained and updated /
    kept current by our corporate IT group.  I have done numerous Internet searches and cannot find anything like this in any other blog.  Thanks for your help.

    Hi,
    Were some of the these data imported from a .csv file? As far as I know, data formats cannot be saved in .csv file. If this is the situation, try this:
    Save a copy of your .csv file changing the extension of your file from .csv to .txt
    open excel.
    go to DATA --> Import external data --> Import data --> browse to find the .txt file you made earlier
    The text import wizard should open.
    Click on delimited, click next
    click comma, click next
    You should now see all columns appear with heading GENERAL --> highlight the columns with the values that are changing to date and click TEXT (top right) instead. The heading of these columns should now change to TEXT.
    click finish
    Excel will now treat the column as text when it imports the data and will not change them to dates
    If this is not the situation, this issue might be caused by some add-ins.
    Start Excel in safe mode:  Press and hold the
    CTRL key, and then click the Excel program to start. Then, click File > Open to open the Excel file.
    If the problem does not occur in the safe mode, this issue might be related to some third-party add-ins in the Office program, we can try to disable them.
    Best Regards,
    Sally Tang

  • ALE, use bd79 (converting data from sender to receiver to blank out fields)

    Hi, I am trying to blank four fields out in our FI IDOC for a certain business reason.  These fields must be blank (it is the FIDCC1 message type).   I am trying to use transaction bd79 (converting data from sender to receiver) maintain rules.  Is there a way to blank out these fields using a conversion rule?  I can change data fine but I cannot find a way to blank or null a field out.  Thanks in advance.

    You should have a look at the inbound function module (linked to your inbound process code). sometimes there are checks that if fields are initial that nothing will be changed.

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • To find the date type fields in the row and validate those date fields

    TYPES : BEGIN OF TY_MARA,
              MATNR TYPE MARA-MATNR,
              ERSDA TYPE MARA-ERSDA,
              ERNAM TYPE MARA-ERNAM,
              LAEDA TYPE MARA-LAEDA,
              MTART TYPE MARA-MTART,
            END OF TY_MARA.
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
          it_mara1 TYPE STANDARD TABLE OF ty_mara,
           wa_mara TYPE ty_mara.
    loop at it_mara into wa_mara.
      describe field wa_mara-ersda type c_data.
    if c_data eq 'D'.
      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
        EXPORTING
          date                            = wa_mara-ersda
       EXCEPTIONS
         PLAUSIBILITY_CHECK_FAILED       = 1
         OTHERS                          = 2
      IF sy-subrc eq 0.
    wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
        else.
            wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
      ENDIF.
      endif.
      endloop.
    This issue regarding how to find the date type fields in the row and validate those date fields.If its not a valid date ,i have to assign initial value to that.
    I've tried that for single field using describe field.Please help me do that for all fields.

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to convert Date format into day in ssrs reports?

    Hi
    How to convert date format into day?
    10/01/2010 as like Monday like that?

    =weekdayname(datepart("w",Fields!mydate.Value))
    -Vaibhav Chaudhari

  • GRR2- 4FM-RepPaint(put ABAP code for convert data in field)

    Hi,
    If somebody know how possible add ABAP code for convert data in some column-field of report (by RepWriter,UserExit,BADI)?
    Thanks a lot.

    Elaborate your question. Not clear ??

  • Name_in(date field) is converted in which format

    using name_in with a date parameter is automatically converted to dd-mon-yyyy character format. How to change this returning format?

    Can you please give us some more information . I mean elaborate your question
    using name_in with a date parameter is automatically converted to dd-mon-yyyy character format. How to change this returning format?
    in my library
    IF par_param_block IS NOT NULL THEN
    GO_BLOCK(par_param_block);
    ls_first_item := par_param_block||'.'||NAME_IN('system.current_item');
    ls_current_item := NAME_IN('system.current_item');
    --Dynamically get parameters from PARAM block (from forms)
    --pass on ITEM NAME / ITEM VALUE in (From the PARAM block into  the sy_print form - as parameters !!!!)
    i := 0;
    LOOP
    IF GET_ITEM_PROPERTY(par_param_block||'.'||ls_current_item, ITEM_TYPE) IN ('LIST', 'TEXT ITEM', 'RADIO GROUP', 'CHECKBOX') THEN
    i := i + 1;
    ADD_PARAMETER(pck_report_pl, 'PL'||i, TEXT_PARAMETER, ls_current_item);
    ADD_PARAMETER(pck_report_pl, 'PV'||i, TEXT_PARAMETER ,
    NAME_IN(par_param_block||'.'||ls_current_item));
    --- for date fields the name_in returns the date in this format dd-mon-yyyy ----
    END IF;
    NEXT_ITEM;
    ls_current_item := NAME_IN('system.current_item');
    EXIT WHEN ls_first_item = par_param_block||'.'||ls_current_item;
    END LOOP;

Maybe you are looking for

  • What does the power adaptor look like?

    Did Apple make any changes to the power adaptor? Is it thinner too? I am waiting a month or two for the 1.6 MBA regardless of changes.

  • Check double invoices

    Dear Team, We have created a vendor in which we have not checked the field "chk double inv" at the first instance. Posted some documents in vendor.   Later on, we have decided to use the "chk double inv" functionality and then we have checked the fie

  • Importing GPS data

    I am having trouble with importing GPS data into Light Rm 4.2. I am shooting a Olympus Tough TG-1 the gps settings are on and the gps data appears to be working on the camera. But when I import the photos by ether tethering to the computer or using t

  • Illustrator is crashing

    I have CS6 version 16.0.2 (in the error reports it says 16.0 for  but i updated and problem persists) Windows vista w/all service packs Illustrator seemed to work fine for about a month but now will crash when I use color guide panel and open certain

  • When trying to connect to itunes store, I get message "itunes cannot connect to the itunes store"

    When trying to connect to itunes store, I get message "itunes cannot connect to the itunes store"