Concat Date and String!

Hello,
My requirement is that I need to concat a string with a date. I tried to convert the date to char but I am not getting the date format and then want to contact with the string.
here is the requirement:
Contact Date: 12/08/2011.
In order to do this, I tried to convert the date into string but having difficulty in getting the date format.
any help is appreciated.
Thanks -

manyam16 wrote:
Hello,
My requirement is that I need to concat a string with a date. I tried to convert the date to char but I am not getting the date format and then want to contact with the string.
here is the requirement:
Contact Date: 12/08/2011.
In order to do this, I tried to convert the date into string but having difficulty in getting the date format.
any help is appreciated.
Thanks -The "tricky" part to what you are asking for is that when you cast a date column as char, the format may change. For example, when I look at my system date as is (it is a date field), the format is as follows:
1/26/2012 5:53:11 AM
When I cast it as CHAR, it appears as follows:
2012/01/26 05:53:11
Why am I saying this? Because the details of the next step will be determined by where the characters are in the string. For this exercise, I will assume that after casting to CHAR, the format is as you say. Then the stringing should look something like this:
Contact Date: 12/08/2011. SUBSTRING(CAST("your date column" AS CHAR) FROM 1 FOR 2) ...to give you the 12
SUBSTRING(CAST("your date column" AS CHAR) FROM 4 FOR 2) ...to give you the 08
SUBSTRING(CAST("your date column" AS CHAR) FROM 7 FOR 4) ...to give you the 2011
So concatenating them, you get:
SUBSTRING(CAST("your date column" AS CHAR) FROM 1FOR 2)||'/'||SUBSTRING(CAST("your date column" AS CHAR) FROM 4 FOR 2)||'/'||SUBSTRING(CAST("your date column" AS CHAR) FROM 7 FOR 4)
Now you can concatenate your text to the above string...

Similar Messages

  • Corrupted date and string in oracle 8.1.6 (WL 8.1)

    i got problem inserting some date and varchar2 column in Oracle 8.1.6, using WL
    8.1 (Oracle's Driver (Thin) Versions: 8.1.7,9.0.1,9.2.0)
    the date and varchar column are corrupted!

    limlk wrote:
    i got problem inserting some date and varchar2 column in Oracle 8.1.6, using WL
    8.1 (Oracle's Driver (Thin) Versions: 8.1.7,9.0.1,9.2.0)
    the date and varchar column are corrupted!Show the JDBC code.
    Joe

  • Concat substring and string question

    Hello,
          So I am trying to add together a string \\fafs10\home and the concat of a substring of the first initial of a GivenName and LastName. I keep getting a NaN error.
    Here's what I have:
    =string("\\fafs10\home\") + concat(substring(GivenName,0,1), LastName)
    I want to return this as a default value to my list.
    Any help would be greatly appreciated. Thank you.
    Matthew

    Hi
    are you doing this in a calculated column or within a rule on an InfoPath form or another way?
    you should probably just go with
    concat("\\fafs10\home\",substring(GivenName,0,1),LastName)
    Regards
    Sergio Giusti Sergio Blogs
    Linked
    In Profile
    Whenever you see a reply you think is helpful, click Vote As Helpful.
    Whenever you see a reply you think is the answer to the question, click Mark As Answer.

  • Search log file line entry (date and string)

    I use powershell 4 and I need to search from a text file if it has a line that contains a date like this '2014-02-12' AND the same line contains some text string like
    'execution successful', that line contains something else but those are the important things. I am a bit lost, I managed to parse it with select-string and split commands but it comes quite ugly and long code. Can I just use regex, something
    like this:
     select-string -Pattern '(2014-02-12)(execution successful)' -Path $myfile
    I want a single line output and then I make an IF sentence that checks if it exists and if it does not, then I create an email alert.

    Hi,
    Here's one possibility:
    $strFound = $false
    $dateStr = '2014-02-12'
    $searchStr = 'execution successful'
    Get-Content .\inputFile.txt | ForEach {
    if ($_.Contains($dateStr) -and $_.Contains($searchStr)) { Write-Host "Found - $_" ; $strFound = $true }
    If ($strFound -eq $false) { Send-MailMessage }
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • What java collection for large amount of data and user customizable record

    I'm trying to write an application which operates on large amount of data. I want user could customize data structure (record) from different types of variables(float,int,bool,string,enums). These records should be stored in some kind of Array. Size of record: 1-200 variables; size of Array of those records: about 100000 items (one record every second through whole day). I want these data stored in some embedded database (sqlite, hsqldb) - access using simple JDBC. Could you give me some advise how to design thoses data strucures. Sincerely yours :)
    Ok, maybe I give some example. This will be some C++ code.
    I made an interface:
    class ParamI {
    virtual string toString() = 0;
    virtual void addValue( ParamI * ) = 0;
    virtual void setValue( ParamI * ) = 0;
    virtual BYTE getType() = 0;
    Than I made some template class derived from interface ParamI:
    template <class T>
    class CParam : CParamI {
    public:
         void setValue( T val );
         T getValue();
         string toString();
         void setValue( ParamI *src ) {
              if ( itemType == src->getType() ) {
                   CParam<T> ptr = (CParam<T>)src;
                   value = ptr->value;
    private:
         BYTE itemType;
         T value;
    sample constructor of <int> template:
    template<> CParam<int>::CParam() {
         itemType = ParamType::INTEGER;
    This solution makes me possible to write collection of CParamI:
    std::vector<CParamI*> myCollection;
    CParam<int> *pi = new CParam<int>();
    pi->setValue(10);
    myCollection.push_back((CParamI*)pi);
    Is this correct solution?. My main problem is to get data from the collection. I have to check its data type using getType() method of CParamI interface.
    Please could give me some advise, some idea to make it right using java.

    If you have the requirement that you have to be able to configure on the fly, then what I've done in the past is just put everything into data pairs into a list: something along the line of: (<Vector>, <String>), where the Vector would store your data and String would contain a data type. I would then make a checker to validate the input according to the SQL databypes that I want to support on the project. It's not a big deal with the amount of data you are talking about.
    The problem you're going to have is when you try to allow dynamic definition, on the fly, of data being input to a table that has already been defined. Your DB will not support that, unless you just store that data pair--which I do not suggest.

  • How to Plot number and string in one row (data logger counter) ?

    hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Duplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...

  • Incrementing a string number for date and time

    There are probably a lot of ways to do this, but I only want to use a bunch of if - else loops if I really need to.
    I have a date and time for input, let's say 2006-04-19 22:00. In Java, if I convert that to 3 integers (year, month, day), it will output 2006-4-19. I need to be able to increment in a loop for every day and month from one date to the next. If I keep it as a string, I won't be able to increment the value though, (at least I'm not sure how). I'm thinking that even if I converted it to an integer and back to a string, that the leading zero would be removed.
    I found a post here that said something about formatting the number with 2 numbers, by using:
    DecimalFormat format = new DecimalFormat("00");
    format.format(1, sb, new FieldPosition(0));
    Or is there a way to use the gregorianCalendar stuff that would output the date with all of the zeros in place, while incrementing and looping correctly?
    Thanks.

    I would get a Date object--you can use java.text.SimpleDateFormat if you're starting with a String--and use that to create a GregorianCalendar. Then you can just call Calendar's add method to add one to whichever field you want. Use the SimpleDateFormat to turn the date back into a String for display again.
    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • Conversion failed when converting date and/or time from character string

    Hi experts,
    I'm trying running a query in Microsoft Query but it gives the following error message:
    "conversion failed when converting date and/or time from character string"
    when asks me the data I'm inserting 31-01-2014
    i've copy the query form the forum:
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > ?) AND T0.RefDate <= ? AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

    Hi,
    The above error appears due to date format is differnt from SAP query generator and SQL server.
    So you need convert all date in above query to SQL server required format.
    Try to convert..let me know if not possible.
    Thanks & Regards,
    Nagarajan

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • How to Sort JTable data using Multiple fields (Date, time and string)

    I have to fill the JTable data with some date, time and string values. for example my table data looks like this:
    "1998/12/14","15:14:38","Unicorn1","row1"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/17","12:14:12","Unicorn4","row6"
    Now the Sorted Table should be in the following way:
    "1998/12/17","12:14:12","Unicorn4","row6"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:38","Unicorn1","row1"
    ie First Date field should be sorted, if 2 date fields are same then sort based on time. if date and time fields are same then need to be sorted on String field.
    So if any one worked on this please throw some light on how to proceed. I know how to sort based on single column.
    But now i need to sort on multiple columns.So what is code change in the Comparater class.
    Thanks in advance.. This is urgent....

    I think your Schedule objects should implement Comparable. Then you can sort your linked list using the Collections.sort() method without passing in a Comparator.class Schedule(Date date, String class) implements Comparable
      public void compareTo(Object obj)
        Schedule other = (Schedule)obj;
        return date.getTime() - other.getDate().getTime();
    }

  • Converting part of the string to a date and subtract with sysdate.

    HINT! In order solve this you must know how the pnr is assembled. Study this:
    650323-5510, we only need the first six characters. They inform us about when the person (car owner) was born. In this case it is 23 Mars 1965. You have to use several oracle built-in-functions to solve this. Hint! Begin by converting part of the string to a date and subtract with sysdate.
    select to_char(to_date(cast(pnr,'YYMMDDMM'))) from car_owner;
    please what am i doing wrong. i need the result to be something like this
    Hans, Rosenboll, 59,6 years.

    Hi.
    The main problem here is you have only last two digits of year. That could be the problem in a couple of years from now, when somebody born after 2k would get in to your database. For now if we ignore this problem the right solution would be :
    <code>
    SELECT months_between(trunc(SYSDATE),
    to_date('19' || substr('650323-5510',
    1,
    6),
    'YYYYMMDD')) / 12 years_old
    FROM dual
    </code>
    Suppose you are expecting the age of the car owner as a result above code will give you that. One again notice the '19' I appended.
    Best regards.

  • Put the current date and time in a string

    I am having trouble trying to put the current date and time from my Calendar object into a string
    any ideas?

    Calendar timeCal = Calendar.getInstance();
    timeCal.setTime(new Date(System.currentTimeMillis() - startTime ));
    String date = formatToTwoDigits(timeCal.get(Calendar.HOUR_OF_DAY))     + ":" +
    formatToTwoDigits(timeCal.get(Calendar.MINUTE))          + ":" +
    formatToTwoDigits(timeCal.get(Calendar.SECOND));
    private String formatToTwoDigits(int i) {
    String ret = null;
    i = i % 100;
    if (i < 10) {
    ret = "0" + Integer.toString(i);
    } else {
    ret = Integer.toString(i);
    return ret;
    You can figure out yourselve how to display the date, use other Calendar.XXX properties.
    Good luck!

  • Problem using string to store evt.target.data and apply property filters

    I have about 9 buttons on my stage and I want to write code for the rollover and rollout effects, I only want to write the code once so I am trying to pass the button info into a string via evt.target.data and it pass the info properly into my string variable but when I try to set my filter to that variable, setting my movieclip instance name to that variable, I get 2 errors:
    1119: Access of possibly undefined property filters through a reference with static type String.
    Warning: 1072: Migration issue: String is not a dynamic class.  Instances cannot have members added to them dynamically.
    My code is:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var thumbArray:Array=new Array();
    var movieClipLoader:Loader;
    var movieClipsStage:Array=new Array(mc0,mc1,mc2,mc3,mc4,mc5,mc6,mc7,mc8);
    toolTip_mc.alpha=0;
    var lumRd:Number=.2127;
    var lumGr:Number=.7152;
    var lumBl:Number=.0722;
    //grayscale
    var grayscale:ColorMatrixFilter = new ColorMatrixFilter([lumRd, lumGr, lumBl, 0, 0,
    lumRd, lumGr, lumBl, 0, 0,
    lumRd, lumGr, lumBl, 0, 0,
    0, 0, 0, 1, 0]);
    //drop shadow
    var ds:DropShadowFilter = new DropShadowFilter();
    ds.distance=5;
    ds.blurX=10;
    ds.blurY=10;
    ds.alpha=.7;
    //varialbe to store movieclips based on rollover
    var whichThumb:String;
    var myXMLInfo:XML;
    var thumbList:XMLList;
    var toolNameList:XMLList;
    var myXMLLoader:URLLoader=new URLLoader  ;
    myXMLLoader.load(new URLRequest("stars.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(evt:Event):void {
    myXMLLoader.removeEventListener(Event.COMPLETE, loadComplete);
    myXMLInfo=XML(evt.target.data);
    thumbList= new XMLList();
    toolNameList=myXMLInfo.star.@toolname;
    thumbList=myXMLInfo.star.@thumbimage;
    for (var n:int=0; n<movieClipsStage.length; n++) {
    movieClipLoader=new Loader();
    movieClipLoader.load(new URLRequest(thumbList[n]));
    movieClipsStage[n].addChild(movieClipLoader);
    mc0.filters=mc1.filters=mc2.filters=mc3.filters=mc4.filters=mc5.filters=mc6.filters=mc7.fi lters=mc8.filters=[ds,grayscale];
    mc0_bu.addEventListener(MouseEvent.ROLL_OVER, thumbRollEffect);
    function thumbRollEffect(evt:MouseEvent):void {
    whichThumb = evt.target.name;
    whichThumb.filters=[ds];
    Thank you for your help!

    kglad, thanks for helping.
    basically, i am a newbie and i'm not clear on your answer . if evt.currentTarget is better, I would like to use the best method, so thanks. i'm trying to get my head around what's going on here in the code. i get that actionscript is storing a "reference" to the object but I don't get why I can't put that reference (which is the name of the movieclip on the stage I wish to apply filters to, i.e. mc0) into a string variable (whichThumb) and then use that string variable to apply the filter (whichThumb.filters=[ds];)
    on one hand, i'm getting error that says "possibly undefined property filters thru a ref with string" which I don't get because the filters are defined outside of the function and are called intially in the load function with no problem. and on the other hand, i am getting another error saying there is a "migraiton issue" with my string not being a dynamic class. do i need to make the var whichThumb another type other than string? if so, what type. maybe that will also solve the "undefined property" issue as well.
    still learning, Thanks for help!

Maybe you are looking for

  • Satellite Pro S300-10J - Question about the microphone voltage supply

    Hi there! I would like to use my S300 10J for acoustical measurements on speakers. (DIY) For that setup, I'm using an electret microphone, the IBF EMM-08: http://www.etfacoustic.com/micpreamp.html for power, this is what it needs: 1.5 - 10V / approx.

  • How do I return an e-library book on adobe digital editions?

    How do I return an e-library book on adobe digital editions?

  • Attach files to a pdf with Adobe LiveCyle Designer 7.1

    Hi, I need to add a button to a form so that it allows me to attach archives to the pdf, somebody knows if this is possible and in that case since it becomes?

  • EntreCheck Results help

    I followed the suggestion to run Entrecheck on my Macbook Pro to see if someone can find the software or hardware causing my slow performance after upgrading to Mavericks a few weeks ago. Here are the results. Any suggestions will be most appreciated

  • Dreamweaver CS3 & XAMPP on Vista

    Hi, I am getting the following error when trying to test a simple php file on a vista machine - XAMPP is installed correctly - I'm sure it is something simple. Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\php\test.php on line 10