Conversion from document to string

I want to perform conversion from document to string for tht purpose i m doing sax parser but in the end i m getting null.The same thing if i do with DOM parser its working fine but some problem with sax parser.
I am attaching the code if anyone can find the problem it would be gr8.
Thanks in advance.
public String DocumentToString(Document doc) {
          StreamResult result = null;
          try {
          SAXParserFactory SAXpf = SAXParserFactory.newInstance();     
SAXParser SAXparser = SAXpf.newSAXParser();
          XMLr = SAXparser.getXMLReader();
     Source sXML = new SAXSource((InputSource) doc);
result = new StreamResult(new StringWriter());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(sXML, result);
catch (TransformerConfigurationException e) {
e.printStackTrace();
catch (TransformerException e) {
e.printStackTrace();
catch(Exception e)
     System.out.println(e);
return result.getWriter().toString();
}

Paddy,
There are a couple of ways to create a Word file.  One is to use the Report Generation Toolkit which includes vi's to create and edit Word documents.  Since you are associated with a university you may already have the toolkit.  The other way is to use ActiveX.  You should be able to find examples of both in the forums.  There may also be an example that shipped with LV. 
Here is one example to get you going http://zone.ni.com/devzone/cda/epd/p/id/992

Similar Messages

  • Conversion from int to String

    How can i convert an int to a String.
    There is no direct String constructor that take only an integer.
    Thanks

    int num = 1;
    String str = "" + num;
    or
    int num = 1;
    String str = Integer.toString(num);

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • Conversion from string "" to type 'Double' is not valid

    We're using BPC 7.5 MS and on patch level 111.02
    There's two front-end servers and one back-end.  we have about 100 users but concurrency is likely in the 50 range.
    We've been running extremely well for about 4 years but are now starting to run into problems.
    There are about 5-6 applications but none greater than 10 million records.  We optimize regularly.
    However over the past two months admin processes seem to take a lot longer.  Optimization now times out after about 1.25 hours and none used to take greater than 15 minutes.
    Today after processing dimensions we checked the application status and we were not able to check if it was available or not.  We got a pop up box saying
    conversion from string "" to type 'Double' is not valid
    I've processed dimensions and applications since and still this error persists.
    We're attempting a reboot to see if that helps but I've never seen this before and in combination with the slower admin processing I'm wondering if there's something drastic going to happen.
    Michael

    Hi Michael,
    for the poor performances you have to check the guides about performance on bpc if you have scheduled regurarly optimize during day and night (just verify that never factwb reach 50.000 and fac2 500.000 records) maybe you need to change some parameter on the server as MaxThreads.
    For the conversion string error on admin console see please this note 1803092 - Set application set status error
    Regards
         Roberto

  • Is there a way to download a text/imessage conversation from your iphone to your computer to print as a document?

    is there a way to download a text/imessage conversation from your iphone to your computer to print as a document?

    Yes. I do it regularly to archive my messages.
    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php
    I use PhoneView and save my texts as a nicely formatted PDF. But, there are other options.

  • Deprecated conversion from string constant to 'char*'

    Hi all
    I am working with strings and i cant figure out why the following
    warning appears at time of build.
    warning: deprecated conversion from string constant to 'char*'
    It appears for the line
    char *myName = "Apple.txt";
    Is there anyone who can help me?
    Help is welcome.
    Thanks in advance.

    Any reason why you aren't using NSString in place of char?
    char *myName = "Apple.txt";
    NSString *myName = @"Apple.txt";

  • Project Conversion from 11.03 to R12- need help

    Hi All,
    I need some information regarding conversion from 11.03 to R12 along with Capital Project's conversion, do we need to take care Asset Assignment and Assets information at the time of Project Conversion. Iam doing Project and Task conversion different. Is there any good mapping document or Conversion FD, if any body have please send my mail ID. [email protected]
    Thanks for your help.
    Thanks,
    Srini..

    Usually only Open Invoices and Unapplied Receipts are migrated from Old system to New Instance.
    Post Migration Reconciliation shall be tough in that scenario. Reconsider/Rediscuss with Client.
    Migration can be done using APIs or Custom Scripts using Standard Interfaces.
    Hope this is helpful
    Regards,
    Sridhar

  • Page numbers incorrect after conversion from Excel to pdf

    Page numbers incorrect after conversion from Excel to pdf
    ""This above link (thread:834599) is from a case back in 2011 that claims to solve this problem, but it does not solve this problem. I think that customer only cared about having continuous page numbering, not discrete page numbering per sheet.
    ========================
    I still have this issue in Acrobat XI and MS Office Professional Plus 2010. I keep upgrading to no avail. This regression has resulted in a huge time drain for me. If you fixed it, please explain how I can get my hands on the resolution.
    Previous versions of Excel and Adobe Acrobat enabled flexibility around the "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) token, depending on context and usage. The "# of pages" token could represent EITHER the number of pages in the workbook OR the number of pages in the tab/sheet, depending on how you generated the PDF:
    You could select "Selected Sheets" and then select all or some of the individual sheets in the workbook, and the PDF would honor the discrete numbering of each of the sheets, so the first page of each sheet was p1 and the "# of pages" was the number of pages in the sheet; not the number of pages in the workbook; or
    You could select "Entire Workbook" and the PDF would honor continuous page numbers across all sheets, as a single document.
    Now, it only honors the total number of pages in the workbook, regardless of the method you use to publish to PDF: saving as PDF, printing to PDF, using "createPDF" from Acrobat plugin to Excel's menu ribbon; selecting all sheets, some sheets, or Entire Workbook; automatic First page number or "1" under Page Setup > Page> First page number. (This last option, btw, does restart every sheet at p1, but it hardly makes sense if the total number of pages is still the total number in the workbook instead of the number in the sheet.)
    I spent a lot of time trying each which way that the blog posts recommended and have tried this on multiple versions of Excel and Acrobat now.
    NONE of these time-consuming experiments gave me what I wanted.They all insist that "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) is the total number of pages in the workbook or the total number of pages in the selected sheets combined.
    The numbering are correct in Excel Page Layout.
    The same issue happens when using LibreOffice calc. (Although, I never tested with Libre Office before, so I don't know that it ever worked).
    The workaround now is to create PDF for each spreadsheet one at a time, and then compile them using the Acrobat combine/binder feature. All alternatives are extremely time consuming and tedious. It used to be automatic. This is a major regression that has gone untreated for over a year now, maybe two years.
    My task takes infinitely more time to complete than it did with previous versions of Acrobat. That means that days are added to my project, when the functionality used to enable a quick pdf generation that was ready for review, now I have to do this very manual time-consuming set of steps to generate a draft. As the project has grown and more tabs are added, my pdf-generation task takes that much longer. We require lots of drafts. It used to be easy and fast. Now it is hard and time-consuming.
    In my opinion, the problem is not Excel; it is Acrobat because it was introduced with an upgrade in Acrobat, not an upgrade in Excel. The problem was introduced in Acrobat 9 or 10. Please provide a patch or add-on or something.

    If you are setting up the page numbers in Excel, the resulting PDF would display the the page numbers created in Excel. On Excel 2010 support page, (http://office.microsoft.com/en-us/excel-help/insert-and-remove-page-numbers-on-worksheets- HA010342619.aspx#BM2) is stated the following "tip" which indicates by default Excel 2010 starts numbering each tab with 1. Exel's workaround tip is below - 
    Set a different number for the starting page
    Tip   To number all of the worksheet pages in a workbook sequentially, first add page numbers to all worksheets in a workbook, and then use the following procedure to begin the page number for each worksheet with the appropriate number. For example, if your workbook contains two worksheets that with both be printed as two pages, you would use this procedure to begin the page numbering for the second worksheet with the number 3.
    On the Page Layout tab, in the Page Setup group, click the Dialog Box Launcher next to Page Setup.
    On the Page tab, in the First page number box, type the number that you want to use for the first page.
    Tip   To use the default numbering system, type Auto in the First page number box.
    Also helpful in the same section is the note on viewing page numbers. To see if the page numbering dilemma originates in Excel make sure you are using the Page Layout View see below:
    Hide All
    If you want numbers shown on pages when you print a worksheet  you can insert page numbers in the headers or footers of the worksheet pages. Page numbers that you insert are not displayed on the worksheet in Normal view — they are shown only in Page Layout view and on the printed pages.
    Overall it may be easier not to create the page numbers in Excel but instead create then in Acrobat using the Headers and Footers option in Acrobat.  I hope this helps - it sounds like a frustrating issue you are experiencing.

  • Error while loading : Time conversion from 0CALDAY to 0FISCPER

    Hi ,
           I get the following error when loading to an ODs .
    My 0FISCPER is mapped to one of the date fields from the extractor (Document date) and also Have 0FISCVARNT as part of data fields  .
    " Time conversion from 0CALDAY to 0FISCPER (fiscal year ) failed with value 20060405 " .
    thanks .

    Hello CG
    Please refere this forum
    Time conversion problem
    Thanks
    Chandran

  • Conversion from u0091Stringu0092 to type u0091Dateu0092

    Hi,
    I am fetching a date from DeliveryDate TextBox from Sales Order. I enter as 10/03/2007. As I need to fetch this value and store it in Production Order DueDate records through SDK Code.When I fetch this value from code,I get as 20070310. When I try to update my Production Order DueDate it gives me an Error Msgbox “Conversion from string “20070310” to type ‘Date’ is not valid.” Here is my code to update production order.
    Dim DelDt As String
    DelDt = MyForm.Items.Item("12").Specific.value
    Here DelDt shows 20070310
    Now I have created an object of ProductionOrder and try to add Records,
    sboProdOrder.DueDate = DelDt
    On the above line it gives me that messagebox.
    Can any one help me as to how can I convert this code in a working one or how to convert the string to date in VB.Net
    Thanks a lot
    Murtaza

    Hi Murtuza,
    Retrieving the value from a date-field through the value always returns the date as a string in the format yyyymmdd.
    the field DueDate is a field of type DateTime.Date. to enter the date in this field, you must convert the string to a date.
    The following line converts the date-string to a date.
    new DateTime.Date(left(DelDt,4), mid(DelDt,5,2), right(DelDt,2))
    Regards
    Ad

  • Date/time conversion from UTC to CET

    Hello,
    Jjust a little question to our SAP BI community!
    Is there a BI function/ggod way that converts a (datetime) string DDMMYYYYHH:MM:SS  in UTC time zone into a string DDMMYYYYHH:MM:SS in  CET timezone ?
    We receive this string in input in a flat file and need it to convert from UTC to CET.
    Or do you know any way to convert a date/time from IUTC to CET, eveen using an ABAP function?
    Thanks a lot,
    Matthieu

    Hi,
    Check this thread for time conversion from UTC to Local time
    [ABAP statement for converting UTC date/ time to local date/time],
    Regards,
    Daya Sagar

  • How to remove empty lines from xml files after removing nodes from document

    <pre>
    Hi
    <b>i have xml document, which is shown below
    after removing some nodes from the document ,i am getting empty lines in place of removed nodes,how to resolve this and get the proper xml document without any errors</b>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE Message SYSTEM "TRD01.dtd">
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>N</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    <MessageType>T</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>EXM</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>TR</SenderSystemId>
    </Header>
    </Message>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>NIHK</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    the xml output i am getting is
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <MessageType>TRD01</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>STL</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>T</SenderSystemId>
    </Header>
    </Message>
    <b>could you please let me know how to avoid empty lines in the xml doucment output</b>
    this is the method i am using to get the result
    public void ValidateRecord(String xml){
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = factory.newDocumentBuilder();
    //parse file into DOM
    /*DOMParser parser = new DOMParser();
    parser.setErrorStream(System.err);
    parser.setValidationMode(DTD_validation);
    parser.showWarnings(true);*/
    System.out.println ("HI THIS xml is validation "+xml);
    Resolver res = new Resolver();
    db.setEntityResolver(res);
    Document doc = db.parse(new InputSource(new StringReader(xml)));
    XPathFactory xpf = XPathFactory.newInstance();
    XPath xpath = xpf.newXPath();
    // XPathExpression expression = xpath.compile("//A/B[C/E/text()=13]");
    String xmlpath="/Message/Header/CounterPartyType/text()";
    String xmlpath1="/Message/Header/RecipentSystemId/text()";
    String xmlpath2="/Message/Header/ErrorSystemId/text()";
    XPathExpression expression = xpath.compile(xmlpath);
    XPathExpression expression1 = xpath.compile(xmlpath2);
    Object result = expression.evaluate(doc, XPathConstants.NODE);
    Object result1 = expression1.evaluate(doc, XPathConstants.NODE);
    Node node = (Node) result;
    Node node1 = (Node) result1;
    System.out.println("the values of the string is " +node.getNodeValue());
    System.out.println("the values of the string is " +node1.getNodeValue());
    // for (int i = 0; i < nodes.getLength(); i++) {
    //System.out.println(nodes.item(i).getNodeValue());
    // CAHNGING THE RECEIPENT NODE
    XPathExpression expression2 = xpath.compile(xmlpath1);
    Object result2 = expression2.evaluate(doc, XPathConstants.NODE);
    Node node2 = (Node) result2;
    System.out.println(node2);
    node2.setNodeValue(node1.getNodeValue());
    System.out.println(node2);
    //removing the nodes from document
    String xmlpath3="/Message/Header/ErrorCode";
    String xmlpath4="/Message/Header/ErrorEnterPriseId";
    String xmlpath5="/Message/Header/ErrorStatus";
    String xmlpath6="/Message/Header/ErrorSystemId";
    String xmlpath7="/Message/Header/ErrorTimes";
    XPathExpression expression3 = xpath.compile(xmlpath3);
    Object result3 = expression3.evaluate(doc, XPathConstants.NODE);
    Node node3 = (Node) result3;
    node3.getParentNode().removeChild(node3);
    XPathExpression expression4 = xpath.compile(xmlpath4);
    Object result4 = expression4.evaluate(doc, XPathConstants.NODE);
    Node node4 = (Node) result4;
    System.out.println("node value");
    System.out.println(node4.getParentNode().getNodeName());
    node4.getParentNode().removeChild(node4);
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    // Node b13Node = (Node) expression.evaluate(doc, XPathConstants.NODE);
    //b13Node.getParentNode().removeChild(b13Node);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    t.transform(new DOMSource(doc), new StreamResult(System.out));
    catch (Exception e) {
         e.printStackTrace();
    System.out.println(e.getMessage());
    </pre>
    Edited by: user12185243 on Apr 6, 2013 6:38 AM
    Edited by: user12185243 on Apr 6, 2013 6:41 AM
    Edited by: user12185243 on Apr 6, 2013 6:43 AM
    Edited by: user12185243 on Apr 6, 2013 6:45 AM
    Edited by: user12185243 on Apr 6, 2013 9:00 AM

    either this way we can do this
    1)
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    <b> factory.setIgnoringElementContentWhitespace(true); </b>
    DocumentBuilder db = factory.newDocumentBuilder();
    or
    2)
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult sr = new StreamResult(sw);
    t.transform(new DOMSource(doc), sr);
    String xml1 = sw.toString().trim();
    <b> xml1=xml1.replaceAll("\\s",""); </b>
    System.out.println(xml1.trim());

  • What is involved in conversion from 8i and 9i or in general .....

    Hi,
    I would like to know what is the process involved in conversion from 8i and 9i or in general from one version to another, especially for the role of technical consultant..
    Any documents or related references that explain the steps to do a successful conversion from a technical applications developers perspective would be great.
    Thanks in advance..

    The counter question would be that how you gonna do migration?
    The other important point would be performance. There are many changes in optimizer behaviour comparetivly to 9i optimizer. metalink has so many references and notes on the same. Searching at metalink would be a good point as well.
    Jaffar

  • Conversion from BO 5.1.9 Deski to BO XI 3.1 SP3 Webi

    Hi Everyone,
    As part of of our project, we are executing a BO upgrade project and have undertaken BO report migration and conversion from deskI in BO 5.1.9 to WebI in BO XI 3.1. The conversion of reports was assumed to be carried out through the report conversion tool (RCT) of BO XI 3.1 SP3. However, RCT has failed in converting all deskI reports to WebI.
    Hence, we are seeking your help & assistance in finding out, the optimal way of resolving the problem. Can you please indicate:
    1. Is there any hotfix/patch that SAP can provide for making RCT more robust resulting in elimination of conversion errors/influence the success rate of report conversion?
    2. If no hotfix for RCT is present, can we get quick answers from SAP through the alliance for resolution of these report conversion errors? We have received the below errors when we made an attempt at report conversion
    1.Breaks in Web Intelligence can only be set on objects present in the block
    2 Objects cannot be hidden in Web Intelligence documents
    3.Page setup options are not implemented in Web Intelligence (First page number, page order, scale, Fit to N pages)
    4.Across options for crosstabs are not available in Web Intelligence -5.Detail variables have no associated dimension in Web Intelligence 6.Conditional or permanent Hide Header not available in Web Intelligence 7.Function not available in Web Intelligence
    8.The formula of a global filter in Desktop Intelligence cannot be migrated into a Web Intelligence report filter
    9.A formula from a Desktop Intelligence block filter cannot be migrated into a Web Intelligence block filter
    10.Unsupported 'Do not retrieve data' option
    11.Conditional or permanant Hide Footer does not exist in Web Intelligence
    12.Keyword not available in Web Intelligence
    13.Unsupported Data Provider
    Anticipating your help and cooperation at the earliest. Please let me know if you need any more information.
    Many Thanks & Regards,
    Sandeep

    Report Conversion Tool cannot guarantee 100% conversion rates. It's imposible due to functionality differences that still exist between Full Client/Deski and Webi documents.
    If you have a report that won't convert - you will have to manualy re-create it in Webi. It'll show you if design you use is even possible there or not.
    As to the list of errors you provided - each one has to be reviewed and investigated to see why it happens.
    Like #3 - might be due to the fact that Webi has no page options or #13 might indicate unsupported data provider, lust like the error says.
    You might want to open a support Incident to properly investigate all the errors you received, but keep in mind - 100% conversion is not possible unless you use simplest reports.

  • Implicit Conversion from data type sql_variant to datetime is not allowed.

     Getting a odd error. This code was working perfectly before a SQLServer upgrade.
    The linked database is working, I'm able to pull up data from it in separate queries just fine.
    I'm getting the following error.
    Implicit conversion from data type sql_variant to datetime is not allowed. Use the CONVERT function to run this query.
    Invalid column name 'TotalDay'. (.Net SqlClient Data Provider)
    can anyone spot the issue? I've tried sever variations of the same code, but still get the same thing.
    If I put this section in a query by it self it works just fine.
    ( DATEDIFF(ss,
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X3
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X3.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate ASC
    ),101),
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X4
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X4.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate DESC
    ),101)) ) AS TotalDayBadge ,

    >ANDCONVERT(VARCHAR(10),X3.TimeDate,101)=CONVERT(VARCHAR(10),@sdate,101)
    It is not a good idea to use string dates for predicates in WHERE clauses.
    Use DATETIME or DATE in predicates.
    If you are not interested in the time part of DATETIME, use DATE datatype.
    Example:
    SELECT CONVERT(DATE, getdate());
    -- 2014-08-25
    Datetime conversions:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Between dates:
    http://www.sqlusa.com/bestpractices2008/between-dates/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for

  • 2013 iTunes purchases not showing up in iCloud

    I've been browsing through discussions for days on iCloud issues, but I haven't come across one quite like mine. In iTunes, I have an extensive library of Music and Movies purchased through the iTunes store, all purchased under the same Apple ID.  I'

  • Problem with *serial no. profile* in work sheduling view of material master

    Hi ! ! I am here with a problem with serial no. profile in work sheduling view of material master. By mistake for some FHMI type ( PRODUCTION RESOURCE TOOLS )materials, serial no profile exist in 'work sheduling' view. Due to that we are facing probl

  • Premiere Pro CC 2014 and Media Encoder CC 2014 not completing encode.

    This is a project that I have been successfully encoding in short segments until now.  Now when encoding, session runs about 10-15 minutes and then ends without error messages.  Removing effects and changing to Mercury PB Engine SW did not help.  Als

  • Installation problems in MSCS ORACLE 10.2 ECC 6.00

    I am writing to report some unexpected installation problems. I am installing SAP ECC 6.00 in a MSCS cluster environment (Windows 2003 / Oracle 10.2) in our production environment and I am having problems during the installing the central instance ph

  • Spool Generation problem in Back ground

    Hi, Can some one let me know what is the problem  in spool generation in the following scenario. I have two reports: ZF003 and ZF005. ZF003 contains the ALV grid which actually  outputs the list. If i run this in background the spool is being generat