Date problem in matrix

Dear all,
I have 2 column in my matrix like Colum1(From Date),Column2(To Date).
First Column (First Row-From Date)I am Entering the value(01-01-2010). Afetr that again
First Column(Second Row-From Date)Iam Entering the value(01-02-2010).Now i want to calculate second Row Date before that  date  like 31-01-2010.That date i want fill in Second Colun(First Row-Todate ).
Regards,
Siva
Edited by: Sivabalan on May 13, 2010 5:16 PM

Hi Siva,
Please refer following sample
Public Class Tester
    Public Shared Sub Main
        Dim birthDay As Date
        Dim lifeTime As TimeSpan
        Dim lifeDays As Integer
        birthDay = Date.Parse("December 25, 2007")
        lifeTime = Now.Subtract(birthDay)
        lifeDays = lifeTime.Days
        Console.WriteLine(String.Format( _
           "There are {0} days between {1:D} and {2:D}", _
           lifeDays, birthDay, Now))
    End Sub
End Class
By
Firos

Similar Messages

  • Problem in Matrix while Populating Data

    Hello All,
    I am facing a problem in matrix column in SAP 8.8
    I am filling a matrix with data from a table ITT1.
    Matrix1 = oChlSelc.Items.Item("3").Specific
    oChlSelc.DataSources.DataTables.Add("Approval")
    oChlSelc.DataSources.DataTables.Item("Approval").Clear()
    Dim Str_Query As String = "Select Father,Code,Quantity From ITT1"
    oChlSelc.DataSources.DataTables.Item("Approval").ExecuteQuery(Str_Query)
    Matrix1.Columns.Item("col_1").DataBind.Bind("Approval", ",Code")
    Matrix1.Columns.Item("col_2").DataBind.Bind("Approval", "Quantity")
    matrix1.LoadFromDatasource
    The problem is that the data is getting populated in the matrix without any problem but the Quantity field is not showing the
    exact Value means its showing the RoundOff Value i.e. 1.45 = 1
    If Quantity is 1.45 in matrix column its showing 1 .
    That what i am facing .
    Thanks
    Amit

    Hi Amit
    Its working fine in my system
    and also im getting the quantity value as 1.00  by using this code
      Dim matrix1 As SAPbouiCOM.Matrix
            Dim oform As SAPbouiCOM.Form
            oForm = SBO_Application.Forms.Item("frm_test")
            matrix1 = oForm.Items.Item("1").Specific
            oForm.DataSources.DataTables.Add("Approval")
            oForm.DataSources.DataTables.Item("Approval").Clear()
            Dim Str_Query As String = "Select Father,Code,Quantity From ITT1"
            oForm.DataSources.DataTables.Item("Approval").ExecuteQuery(Str_Query)
            matrix1.Columns.Item("V_0").DataBind.Bind("Approval", "Code")
            matrix1.Columns.Item("V_1").DataBind.Bind("Approval", "Quantity")
            matrix1.LoadFromDatasource()
    Thanks
    Shafi

  • Problem with Matrix/Checkbox/Datasource

    Hi, i have a problem with a Matrix.
    There are 3 Columns on this Matrix, one of those is a Checkbox. I fill the Columns with data, the Checkboxes where just added (no Checkbox is selected), the user has to select the value (Checkbox)he want's to by hand.
    After i filled the Matrix i can see all the data on the Form, it's OK, but then i loose all entries after SBO is doing some work. There where shown only the empty rows and the checkboxes.
    I guess it has something to do with the databinding. My problem is that i don't have the Data for this form on a db-table. I fill in the matrix the result of some querys. It looks like i need at least a DB-Field for the checkboxes, otherwise there are not working (not selectable)
    Somebody knows a solution how i can keep the Data in the Matrix after SBO is doing some work? What could be the reason that i loose the data after filling it in the Matrix? Is there an easy way?
    Thanks Andreas

    Almost every item on a form need a datasource... If the item reprecents some data in a table the databinding must be a dbds... If the data does not reflect any data in a table (Calulated value, user-decision, ect.) a userdatasource need to be created...
    Add a userdatasource
    oForm.DataSources.UserDataSources.Add(UID,type,length);
    Databind to DBDS
    col.DataBind.SetBound(true,”TABLE”,”FIELD”);
    Databind to UDS
    col.DataBind.SetBound(true,””,UID);

  • Date format in Matrix loaded by DataTable is shown as 20080319

    Hello,
    I've loaded most of our matrixes with DataTables. No problems up to now. Also date columns where shown in correct B1 GUI format.
    But now with a new matrix the date is 'suddenly' shown as '20080319'. When I view at B1 system information (at the bottom of B1) the column is described correctly with B1 GUI format:
    U_DateEndPr (Date)
    19.03.2008 [Form....Item..., U_DatEndPr]
    I've made a test (one of many):
    I've loaded the 'problem-matrix' with some columns (including one date column) from another DataTable which works correctly on another Matrix/Pane.
    The result is the same:
    In the first (correct working) matrix (pane 1) the date is 19.03.2008 and
    in the second matrix 20080319
    Is there something wrong with the matrix itself?
    I have absolutly no idea where my fault is.
    Does anybody made the same or similar experiences?
    So long,
    Roland

    Hello Petr,
    for the test which I've made i can say yes: I've loaded the problem-DataTable with the same query as the working dataTable.
    The only difference is:
    The problem-matrix has less columns than the working matrix. So I couldn't bound the problem.-DataTable/Matrix to all of the query result columns.
    Another hint:
    The Date format '20080319' looks like the result of SDK-ValueEx (B1-DB-Format-String)
    In another column beside '20080319' there's a double-value. This is shown with the correct decimal-separator of B1 (I've changed decimal sep. to '#' for test. The columns ar shown as:
    '20080319'  |  142#89
    ...so the second column is displayed correctly but the date format is still wrong...
    And:
    I get the same result when I do the problem-DataTable bind to exactly the same dataTable-UID as of the working DataTable.
    So at the moment I suppose that the error is in the Matrix-Object. Because both matrixes are loaded by the same DataTable (for trial) and only one of them shows wrong date-format.
    I forgot:
    The form with the problem-matrix was made with a 2 years old screenpainter. Althogh I've made changes on the form with a actual screenpainter - could this be a problem?
    Hmm, but I don't think so because on another pane and matrix of the same old form the date works corectly...
    Edited by: Roland Toschek on Mar 19, 2008 1:07 PM

  • Can't fill in a date field in matrix and UDO

    Hi
    I have created 2 usertables (docuemnt and documentlines) and I created an UDO of it and create a user def form.
    In the documentline table (data in the matrix), there are 2 date fields. I fill the dates in de dbdatasource of the matrix but in the database it remain a null value.
    following code line seems not to work
    oDBPIT_AUTSTOCK_DET_1.SetValue("U_DOCDATE", Row, docdate)
    After this line:
    oDBPIT_AUTSTOCK_DET_1.GetValue("U_DOCDATE", Row)
    returns an empty string.
    I did several tries: Let the docdate as DATE, or as string, even
    sboBOB.Format_DateToString
    seems not to work.
    How can I solve this problem, Has anyone a clue?
    Eddy

    Hello
    In order to learn how to fill UDO tables please refer to the following link:
    <https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_sbo_sd/~form/handler>
    Please note that the TableName.txt file should include all fields and not only (code, name and your user fields) as described in the document.
    The fields should be separated with tab.
    In the data lines you donu2019t need to put values in all the fields.
    Please refer to the attached text file as a sample.
    Best regards,
    Miki

  • Help needed with missing data problem in CRVS2010

    We recently upgraded the reporting engine in our product to use Crystal Reports for Visual Studio 2010 (previously engine was CR9). Our quote report, which has numerous subreports and lots of conditional formatting, started losing data when a quote took more than a single page to be printed. We knew the SQL results included the data, but the report was not printing those lines at all or sometimes printing a partial line. In addition, the running total on the report would exclude the lines that were being missed on the next page. In one example submitted by a customer, 3 lines were skipped between pages.
    I think I have identified two potential issues that document the possibility of data not being included in the report.
    The first potential issue is an issue with the "suppress blank section" option being checked. This issue is supposedly fixed with ADAPT01483793, being released someday with service pack 2 for CRVS2010.
    The second potential issue is using shared variables. This issue is supposedly fixed with ADAPT01484308, also targeted for SP2.
    Our quote report does not explicitly use shared variables with any of the subreports, but it does have several subreports, each in its own section that has the "supress blank section" option checked. We have other reports that use this feature, as well, and they are not exhibiting the problem.
    One different thing about the quote report is that it has a section with multiple suppression options selected. The section has a conditional suppression formula, which controls whether the section is included at all within the report. The section also has the suppress blank section option selected. There are multiple fields within the report that are each conditionally suppressed. In theory, the section's suppress formula could evaluate to true, yet all of the fields within the section are suppressed (due to null values), and then the "suppress blank section" option would kick in.
    The missing data only seems to happen when the section is not being suppressed, and at least one of the fields is being included in the report. If I clear the "suppress blank section" check box, and change the section formula to also include the rules applied to the fields in the section, the missing data problem seems to be resolved.
    Is this related to ADAPT01483793? Will it be fixed in service pack 2?
    If more details are needed, I would be happy to provide a sample report with stored data.

    Hi Don,
    Have a look at the Record Selection formula in CR Designer ( stand alone ) and when exported to RPT format opening that report in the Designer also. 
    There's been a few issues with => logic in the record selection formula. It could be you are running into this problem. Look for NOT inserted into your selection formula.
    Oh and SP2 is coming out shortly so it may resolve the issue. But if you want you could purchase a support, or if you have a support contract then create a case in SMP and get a rep to work with you to debug the issue.
    If you have not try the Trial Version of CR 2011, put it on a VM-ware image or Test PC so you don't corrupt anything for production and have a look at and test it in that designer also. If you purchase a case and it is a bug then you'll get a credit back for the case.
    Don
    Edited by: Don Williams on Oct 26, 2011 7:40 AM

  • Clearing of Balance in GR/IR clearing account due to date problem

    >Hi to All,
    >The scenario is like this :-
    >The client is making back dated entries for quarter between 01.04.2008 to 30.06.2008 in SAP in July 2008 as the system is getting implemented now. He wants to regularise all the transactions in SAP from 01/04/2008.
    >The users entering the data were new and hence though the miro and payment entries were made by F&A in back date. The Purchase Orders and the GRs were prepared in the current date of July 2008.
    >Because of this date problem the GR/IR clearing account is having balance in it, which should have been clear after the processing of the miro document.
    >The documents were handed over to f&a after preparation of GR in the systems for Invoice processing through MIRO.
    >Can anyone plz give a solution to clear the balance GR/IR clearing account.
    >Thanks in advance.
    >Ashutosh M Joglekar.

    Hi Muthuraman,
    No need to clear any thing for PO pending items.
    Regards
    Gitesh

  • My macbook pro recently got swiped and I lost all my data, problem is, just before it was swiped I set up my new iphone 5 which transferred all my photos and music over which is no longer on the computer. What will happen to my phone if I plug it in?

    My macbook pro recently got swiped and I lost all my data, problem is, just before it was swiped I set up my new iphone 5 which transferred all my photos and music over which is no longer on the computer. What will happen to my phone if I plug it in?

    I never used icloud before so there is no data to back up from. I just spoke  to the apple store and they said that if I do plug it in, all the data will be swiped....is there a program I can use to transfer my data from my phone to computer without loosing it all ???
    Renee

  • Report Server 2008 R2 incorrect Data in Report (Matrix)

    Hi,
    i try to build a report based on a stored procedure.
    Query returns data like:
    The Matrix should show data per EmplID and FOSGRP (Rows) and per BaseType Column.
    But the matrix shows data like this (eLearning and ILT are different Basetypes). Rows and Columns are correct but not the values, the are completly wrong, as you can see in the image above.
    Matrix shows data like this:
    The correct Totals should be eLearning = 11.01, ILT = 12. Where are the wrong Values come from?
    Total on FOSGRP.
    The matrix contains 2 rowgrouping 1. per Emplid, 2. per FOSGRP and 1 Column Group per BaseType (contains elearning/ILT).
    I tried out as well with a table object and it shows as well wrong numbers.
    Whats going wrong here? Wy is SSRS doing calculations on the detail data?
    The RawData returned from the query works fine in Excel Pivot, its doing the correct Totals
    Thank you for any idea and help
    Ivo

    Hi IvoSutter,
    According to your description, you have a store procedure to retrieve data from database. Now you find the data displayed in matrix was different from the records returned from query. Right?
    In this scenario, your report design was correct. In Reporting Services, if it only returns 4 rows in Query Builder, it supposed to show the same records in the report. Based on your second picture, it seems has other records for
    the EmployeeID so that the TotalCredit is not correct. Please try to execute the query in both Query Builder and SQL Server Management Studio. Check if they return same records. As we tested in our local environment, it works properly. Here are screenshots:
    If you can't get the same records in those two environment, please restart the Report Server in Reporting Services Configuration Manager.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Will apple next update to help fix the location following data problems will the ipod touch 2g be included ?

    will apple next update to help fix the location following data problems will the ipod touch 2g be included ?

    Chances are the 2g itouch will not be included in the update. Also no one yet knows if it will be fixed in the next firmware but apple has said they know of this bug.

  • Problem with matrix/screen in Qosmio F55-Q502

    Hello
    For a few weeks I have strange problem with matrix/screen in my laptop.
    The matrix flickers very often - no matter if power cable is plugged or not.
    The screen is full bright and suddenly it starts to blink - it is getting darker, than lighter, usually for few/dozen seconds. It does it when nobody touches it or when I work on it.
    It very annoying and making eyes tired - it does it very quickly and there are few levels of screen brightness.
    Moreover sometimes the screen turns off - You can see what is on desktop but the screen is very very dark (but not blank or completely switched off). It happens without any reason - sometimes just in the middle of working, sometime for example when I touch (not pull) the power cable between laptop and power supply.
    Then, the only way to get back to normal brightness of screen id to close the lid just for half a second and open it
    - matrix lights then normally, but can "turns off" moment later and I must do it once again - sometimes even few times..
    After "action" with lid screens seems like nothing ever happen..
    Does anyone have idea what is the cause of such behaviour or how to diagnose it in details?
    Or maybe solve this problem?
    Best regards
    300m

    Sounds like the Backlight or Inverter is failing or there is a loose connection.
    Is the unit under warranty? Send it to an ASP for repair.
    You should avoid repairing it yourself, the backlight is very high voltage!

  • A Full DTP is converted into delta DTP and facing some data problem

    Recently Full DTP(DSO to DSO) is converted into delta DTP , we are facing some data problem in first request.Some data in D2 are not updated properly after just converted in full to delta. Please let me know if you have any idea.
    Example :
    DSO : D1
    DSO : D2
    Previously FULL DTP D1->D2
    Now Delta DTP D1->D2

    Hi,
    First time run of delta DTP will extract all the records from the source...
    As u have already run the Full load and followed by delta,i guess u can use direct change log option...
    rgds,

  • Parsing Date Problem

    I have date problem that I am finding hard to resolve. Please
    suggest me what I could do.
    I want to parse String Date values of formats like "19 Jun 2003" and
    "19/06/2003" to a Date object.
    Can I Do it.
    Thanking in Advance.

    Sure. See SimpleDateFormat#parse.
    Kind regards,
      Levi

  • [JHS10.1.3] Date problem

    Running into a date problem for a forms migration.
    I have a date field in the database, normal date field.
    The users want to be able to search on partial dates.
    So adding a between on this field will only generate two date selectors, which is not what they want.
    The format is like a year field, week field, day field.
    I could modify the query to return three extra numeric fields which convert the date to the right format ('yyyy', 'wi', 'dd' ) and then to number and generatie 3 between fields for this.
    This will generate the right layout, 6 input fields for a year from/to week from/to day from/to
    But the query will be like (year between x and x) and (week between x and x) and day (between x and x)
    This will not produce the right results.
    What is possible is a string manipulation of the whereclase in the method getViewCriteriaClause()
    And see if any/all of the fields are filled and build the query there, but this is not a 'clean' solution.
    Any idea on how I can solve this? Basicly a date field in the database, user wants to search that date field on year/week/day between year/week/day or a partial of that.
    This is the way it used to be in the forms application so I really want to give the same functionality with ADF.
    Anton

    Not sure if I completely understand what you said, but this is what I did ( it seems to work )
    All my viewobjects extends a new superviewobjectimp, this class has just 2 setters and getters, one for the datefield I want to search on and one for the partial name I gave the three attributes (<fixed name>Year <fixed name>Week <fixed name>Day).
    In the advancedSearch, in the loop trough the attributes I cast the viewobject to this superviewobjectimp. I can now check if the attribute contains the partial name. If this is the case I build my own string and add it to the viewCriteriaMap.
    One odd thing I found here is that it refuses to let me add a string like
    between to_date( '<startdate>', 'yyyy-mm-dd' ) and to_date( '<enddate>', 'yyyy-mm-dd' )Because if I do this, for some reason the attribute name will be wrapped in a to_char!
    If I just leave:
    between '<startdate>' and '<enddate>'It works, but I dont feel really safe about that, I would rather use the datecast to be sure.
    Any idea how this can be done?
    I also used the java Calendar class to transform a yyyy-iw-d to a yyyy-mm-dd because it seems I cant use 'iw' in a to_date(....). This also solved a problem with partial dates, java will autocomplete them for me.
    In other words if I only supply the year 2005 to 2006 it will auto search from 2005-1-1 - 2006-1-1, same for weeks.
    I have a lot of viewobjects which will require this, I'm trying to make it as solid as I can.
    Any suggestions?
    Anton

  • I have a strange 3g data problem.

    I have a strange 3g data problem.  At home I have zero 3G connectivity even though all bars are showing and says "3G" and wifi is "Off" ... unless I am on the phone and then magically the 3G data connection works perfectly!!  Does anyone have any idea what is happening?  Also when I bring my phone to my dad's or my friends house the problem disappears!! Is this a hardware or a AT&T network problem? os is 4.3.3
    Also called ATT and they said there was no problem with the network and that it was a hardware issue.  Also restored the phone several times but the problem did not go away.

    OK, no trouble shooting. The first thing I'd attempt is restarting in Safe Mode. If you still don't have luck try doing both a SMC and PRAM reset, it wouldn't hurt to do the SMC reset a couple of times. If still no luck let us know.
    SMC RESET
    Shut down the computer.
    Unplug the computer's power cord and all peripherals.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Attach the computers power cable.
    Press the power button to turn on the computer.
    PRAM RESET
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

Maybe you are looking for

  • Cannot boot after recovering a FileVault 2 protected disk

    I used Lion's new recovery HD partition to restore a four day old Time Machine backup. However, two days ago I enabled FileVault 2, which is probably the cause of the fact that I cannot boot my mac anymore. As the whole disk is locked, I cannot acces

  • URL won't link to local file on disk

    I want to make an object link to a html file on the local disk (I can't be sure I'll have internet access when I'm presenting). Keynote '08 seems to reject everything I've tried to do this; it doesn't accept "file://...." URLs. It seems to only accep

  • Using ibook as pilot monitor

    Can a G4 ibook be used as a pilot monitor - in other words, display the desktop on ibook and then open a programme like Word and display it on an extrenal monitor whilst still being able to see the desktop on the ibook screen?

  • Help Identify Card

    Recently bought HP Pavillion 7670 (Core Duo E6600) which comes with "Ati Radeon x1600se 512 MB" video card. System running Windows XP MCE 2005 (all up-to-date) I have identified this to be manufactured by MSI [MS-V040B0609060667]. However I cannot fi

  • Interactive report custom GO-Button (-process)

    hello, is there a way to customize the behavior of the IR Go-Button? I'd like it to make a dynamic IR by using collections build depending on the values of two other fields on the page. everything works fine when using an extra button but I want the