Convert string type data

I use CF10 Builder.

I need to convert a 6 character string and compare it to a string of 20 characters.

Entry = 201516 must be converted into 201508 and 201601. I try to handle the conversion in my query and does not all the records that I don't want to count for my report. IF it is a better way, I'm open to suggestions. Here is the code in my query that gives me a "Conversion failed when you convert the value varchar 'E' type of int data.

WHEREName.soc_sec = transact.soc_sec
AND name.soc_sec = prospect.soc_sec
AND name.soc_sec = approg.soc_sec
AND name.soc_sec = nmcrs.soc_sec
AND name.soc_sec = transact.soc_sec
AND transact.accept <>'v '.
AND transact.tcodes = 'AW '.
AND name.last_name not like '% test % '.
AND prospect.term_int NOT BETWEEN LEFT (rpt_schy.sch_yr, 4) + '08' AND LEFT (rpt_schy.sch_yr, 2) + RIGHT(rpt_schy.sch_yr,2) + '01'

AND transact.sch_yr = rpt_schy.sch_yr

Any help would be greatly appreciated.

By the process of elimination, if you delete the whole where clause of your query, do you still get the error?

See you soon

Eddie

Tags: ColdFusion

Similar Questions

  • Convert String to DATE

    Hello

    There is a '20091002' chain, and I need to convert it to this day.

    20091002 is in format YYYYMMDD - the VARCHAR2 data type

    I need the above in DD/MM/YYYY - DATE datattype

    '20091002' (VARCHAR2) - 10/02 / 2009 "(DATE)

    Thank you

    Aman

    Hi, Aman,

    user13115886 wrote:

    Hello

    There is a '20091002' chain, and I need to convert it to this day.

    20091002 is in format YYYYMMDD - the VARCHAR2 data type

    I need the above in DD/MM/YYYY - DATE datattype

    ...

    You are contradicting yourself.  All dATEs have the same format, and it's nothing like YYYYMMDD or DD/MM/YYYY.

    If you need a DATE, use TO_DATE:

    To_date (str, 'YYYYMMDD')

    but it will not be in the format MM/DD/YYYY

    If you want to convert a string into a format to another string in another format, and then use the string manipulation functions to reorganize secondary channels, for example

    REGEXP_REPLACE (str

    '(\d{4})(\d{2})(\d{2})'

    , "\2/\3/\1".

    )

    or

    SUBSTR (str, 5, 2) | '/' ||

    SUBSTR (str, 7, 2) | '/' ||

    SUBSTR (str, 1, 4)

    but it will not be a DATE.

    If you were certain that str contains valid data, then you can call TO_DATE to convert a DATE and then call TO_CHAR to convert the DATE to a string in the format MM/DD/YYYY.  I do not recommend, because it is likely that the strings would not be valid.  It's one of the reasons why you should use DATEs to store the date information.

  • How to convert String to Date

    hell there everyone,

    I have a question which is:

    How to convert a string that we get by reading an XML in the instance of date value type?

    So there is a XML that modifiedDate as an attribute on a node of the XML and how I put this value in an instance variable date?

    the timeformat in the XML file is: mm/dd/yyyy hh: mm: = > 31/12/2010 23:57:46

    I chose this time format because I want to use the method . parse() which always causes an error, but that's another topic...,.

    hope I was clear on the issue,

    Thanks in advance for the help.

    First of all, you should watch the Date object constructor to find out how to specify different parameters.

    public void Date (yearOrTimevalue:Object, month:number, date:number = 1, hour:number = 0, minute:number = 0, second:number = 0, millisecond:number = 0)

    Then you need to determne how to break the string by using the String.Split method.  The first split() should be the space between the date and time, the second for the slashes in the date and the third for the colon in time.

    Then you come to take each of these paintings of substrings and feed them in the constructor as the Number() values.

    If you remain unsure how to do this, look at the different terms that I have identified in the help documents and you will find them all explained with examples.

  • How can I convert String type to a Type of BinaryEntry?

    We must differentiate between the keys that come to the custom editor Erase method. So, we have added ' | ' at the end of the key as below

    key = "a"; Actual key which is cached

    If (//some condition)
    {
    newKey = "a" | newKey to differntiate
    getCache () .remove (newKey);
    }
    on the other
    getCache () .remove (key);

    Now, the call comes to our custom editor Erase method. Here, we must perform a different operation of the key which has ' | ' in there. So, we have added below code in the custom Erase method.

    public void clear (BinaryEntry binEntry)
    {
    Key of type string = (String) binEntry.getKey ();
    If (Key.Contains("|"))
    {
    You will need to do a DB here. Then,
    now, the key is "a |" We need to eliminate the "|" symbol and call the Delete method to delete the current key ('a') of the cache. So we added code below

    Replace string newKey = (nom_domaine_dns) ("|", "");

    Here, the problem is, key is of type String. But Erase method can take only BinaryEntry type. So, we tried this

    binEntry = (BinaryEntry) (binEntry.getContext () .getKeyToInternalConverter () .convert (key));

    Super.Erase (binEntry); but it dint work. The entry is not deleted from the Cache.

    How to convert key to type the string to BinaryEntry?

    }
    on the other
    {
    Super.Erase (binEntry);
    }
    }


    Can anyone suggest?

    Hello

    Yes, JK is right! I forgot that the remove() will remove the entry from the BackingMap. Another alternative would be to use the EP below:

    public class EP2 extends AbstractProcessor implements Serializable{
         private boolean isSynthetic;
    
         public EP2(boolean bln){
              this.isSynthetic=bln;
         }
         @Override
         public Object process(Entry entry) {
              BinaryEntry binEntry = (BinaryEntry) entry;
              if (isSynthetic){
                   //Synthetic Remove                    
    
                   // This is a bug and should evict entry and not call erase
                   //binEntry.remove(isSynthetic);   
    
                   //Alternative solution is to expire with a minimum delay of 1 ms
                   //This will call the store method so make a check of the original and new value and do nothing if they are same to avoid DB update
                            binEntry.expire(1);
    
              }else{
                   //Will hit the cache store
                   entry.remove(isSynthetic);
              }
              return null;
         }
    }
    

    Client side, make a call to delete as below:

    cache.invoke(key, new EP2(true)); // coherence eviction only
    
    cache.invoke(key, new EP2(false)); // for invoking erase()
    

    I hope this helps!

    See you soon,.
    NJ

  • Convertion of String type to the class

    How to convert String Type for the class...
    I want to dynamically create an instance of a class.

    for example.
    If I have a sring 'className1 '.
    How to create a new instance of-> new className1()

    THX in advance
    Angel

    Angel,
    I asked this a few weeks ago and got this. This is in response to a specific question about a number to create a power class, but the idea is there. Its in the "getDefinitionByName()".

  • String to date Conversion inside XSLT

    Hi all

    I want to convert a string of (Eg: 2009-12-06 00:00:00) to a type of format date yyyy-mm-dd Vice versa.

    I managed to convert the Date to a string

    < element name = "input" type = "date" / > (schema)

    < element name = "result" type = "string" / > (schema)


    < ns1:SIDtoCRMProcessResponse >
    < ns1:result >
    < xsl: value-of select = "xp20:format - dateTime (/ ns1:SIDtoCRMProcessRequest / ns1:input,)" [M01] / [D01] / [Y0001] [H01]: [m01]: [s01] ")" / > "
    < / ns1:result >
    < / ns1:SIDtoCRMProcessResponse >


    but when try to String in Date

    < element name = "input" type = "string" / > (schema)

    < element name = "result" type = "date" / > (schema)

    < ns1:CRMToSIDProcessResponse >
    < ns1:result >
    < xsl: value - of select = "xp20:format - dateTime(/ns1:CRMToSIDProcessRequest/ns1:input,"[Y0001]-[M01]-[D01]")" / > "
    < / ns1:result >
    < / ns1:CRMToSIDProcessResponse >

    his failure

    I think the format dateTime function expects the entry date. Can someone kindly help me how to convert String to Date inside a xsl without using the external java function.
    Thank you

    you could use some dirty concatination to build the format yourself.

    not going to win the beauty contest but

  • Convert String performed far and format her

    Hello

    I am new to Adobe and javascript. I have a string value that stores the Date of birth in yyyy-mm-dd format, as a string. I need to convert this Date and then place it on a PDF field in the format mm/dd/yyyy.

    Can anyone help?

    Thank you

    You can convert a string representing a date in a date object using the util.scand JavaScript method and and then format a date to a string object by using the util.printd method. For more information, see:

    http://livedocs.Adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1254.html

    http://livedocs.Adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1251.html

    In your case, the code would be something like:

    sDate var = '2013-01-10;

    Convert string to date

    Kai var = util.scand ("yyyy-mm-dd", sDate);

    Convert date to a new string

    var sDate2 = util.printd ("mm/dd/yyyy", anyway);

    Set a field value

    getField("date2").value = sDate2;

    The exact code you use depends on where you place the script and where you get the original date string, but this should help you get started.

  • I want to convert the double data type to string type

    I want to convert the double data type to string, have idea about that

    Hello

    Use f

    FN: String (ARG) returns the string value of the argument. The argument can be a number, boolean, or node-set element

    Example: string (314)
    Result: "314".

    http://w3schools.com/XPath/xpath_functions.asp#string

    See you soon,.
    Vlad

  • Convert from type string to type task DAQmx

    Hi all

    I would like to know if it's possible to convert type string DAQmx type (task DAQmx in)

    Thank you!

    This error is not associated with the conversion of the string type. I don't really know what is happening in your application, but I suspect that you are getting the error because you have not configured/registered your task properly, possibly in another application on the same system. I saw this problem before when functional using globals to save a task in one application and then read the overall task of the functional by using an another VI. This usually occurs because the functional world will save the value associated with the particular task. I would recommend that you look for the error code on the website and have a look at the following article. I apologize, but my knowledge is limited on this error.

    Recorded by program channels, NOR-DAQmx tasks and examples of scales

    TonP, I was avoiding the point of constraint

  • Problem with convert the string to date using DateTimeStringConverter

    Hello

    I would like convert string date (JJ/MM/AAAA) - it is useful to compare dates in TableColumns.

    so I use DateTimeStringConverter (the string "01/11/2014" is a value of date picker)

    DateTimeStringConverter format = new DateTimeStringConverter (Locale.FRANCE,

    "dd/MM/YYYY");

    Date d1 = format.fromString("01/11/2014");

    D1. ToString()

    "I do not get the right date, but that date =" Mon Dec 30 00:00:00 THIS 2013!

    I don't understand what the problem is (which in fact should not be a problem)?

    Any ideas?

    Thanks in advance

    Fabrice

    You have an error in the spec use format ' dd/MM/YYYY' instead of 'dd/MM/YYYY '.

    DateTimeStringConverter f = new DateTimeStringConverter(Locale.FRANCE, "dd/MM/yyyy");
    Date d1 = f.fromString("01/11/2014");
    System.out.println(d1.toString()); // --> Sat Nov 01 00:00:00 CET 2014
    

    If you do not need long, I would use DateStringConverter

  • convert the varchar2 data type to the data number type

    How to convert the varchar2 data type to the data type number.


    It looks like my data

    create table one)
    col1 varchar2 (50)
    col2 varchar2 (500);

    Insert in a (col1, col2) values ('1234 ', ' 2345');

    Select Column1 of number (19)) cast (to_number (col1);

    IAM getting error invalid number


    I need to create a table with the same columns with data like number types (19)

    can someone help me

    Thank you

    You have changed your original post, so now I see that you get the invalid number.

    This is why you should always avoid the varchar columns to store numbers or dates...

    Since your table source contains a nonnumeric value, you can write a pl/sql to convert data and see what records are false:

    SQL> insert into a (col1,col2) values ('xxxx','2345');
    
    1 row created.
    
    SQL> select * from a;
    
    COL1     COL2
    -------- --------
    1234     2345
    xxxx     2345
    
    2 rows selected.
    
    SQL> create table b (col1 number(19), col2 number(19));
    
    Table created.
    
    SQL> set serverout on
    
    SQL> declare
      2  cursor c is
      3  select * from a;
      4  begin
      5    for r in c loop
      6     begin
      7       insert into b values (to_number(r.col1), to_number(r.col2));
      8     exception
      9       when invalid_number then
     10        dbms_output.put_line('Row rejected: col1='||r.col1||' col2='||r.col2);
     11     end;
     12    end loop;
     13  end;
     14  /
    Row rejected: col1=xxxx col2=2345
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from b;
    
          COL1       COL2
    ---------- ----------
          1234       2345
    
    1 row selected.
    

    Max

    Published by: Massimo Ruocchio, June 14, 2011 20:00
    Added the first query in the example

  • convert the money data type in a decimal format 2.

    What is the best way to convert the money data type in a decimal 2 format in ms sql 2005 for use in my applications.

    This?

    CAST (tr.depositReceivedAmount AS decimal (10, 2))

    I respectfully disagree with the idea that you must change the query column a type of 'money' data to something else.

    In most database servers, "«argent» Silver" is a data type that is designed to provide a very homogeneous behaviour with regard to the arithmetic accuracy.  In Microsoft Access, the representation is a the whole scale.  MS SQL Server, it is obviously similar.  Ditto Oracle and others.

    You like that the money data type in the database for this clarification, because "hell has no fury like an accountant looking for a bad penny."   The column of database storage formats are designed to satisfy the accountants, and it's a good thing.

    Meanwhile, you also want to take care as to exactly how you are dealing with values.  There are several points where the district could take place.  You don't have available the strongest possible manipulation of the floating of the data types in ColdFusion.  You also are somewhat at the mercy of any interface software can be between you and that SQL server, you can use.  "It is correct to all about values , but not several times."

    I suggest to round the value just before the display and user input must be two decimals.

    Then, you may need to do some things at the end of SQL server.  For example, when you update a value in the table, you may need to use logical server to explicitly truncate the value to two decimal places, as well as an update of "$ 34,56" explicitly updates the column "$34,5600.."  (This kind of thing should happen in the context of SQL Server).  You know that the user entry has exactly two significant digits, but maybe (maybe not...)! SQL server may not know this.  You want to ensure that the stored server internally represents exactly two digits, when the origin of a user input value.

    Do not err on the side of "convenience" or "which seems." good on the screen  (If you do, get ready get telephone communications of the accountants, always at inappropriate times of the night.)

  • Convert a varchar2 data type Date

    Hi guys,.

    Can someone help me convert a Varchar2 data type in the data type Date?

    I have a query and my column is a varchar2 data type.
    I want to just that convert the Varchar2 in a DATE, because I met
    problem in my query. I want to do the day1 day10 transaction.

    Ex:
    Day 1 = January 1, 2010
    Day10 = January 10, 2010

    table.record_date varchar2 (12)

    SELECT column1, Column2
    table
    where record_date between? and?

    How can I set the record_date between day1 and day10 since record_date is of type varchar?

    Thank you.

    Laetitia

    Lala,

    If the data in the database are in the format MM-DD-RR , then you must use the same format when you convert back to this day.

    So change the query to

    SELECT COLUMN1, COLUMN2 FROM TABLE WHERE TO_DATE(RECORD_DATE, 'MM-DD-RR') BETWEEN TO_DATE('01-JAN-2010') AND TO_DATE('10-JAN-2010')
    

    Kind regards

    Manu.

  • Convert float to date data type

    How to convert the float to type date data type... the time stamp is actually stored type float in one of the tables.can, I use the cast function?

    For example... 39086.4047337963 (to convert to the format of the timestamp or date)

    user8813441 wrote:
    I got the answer from one of the forums

    SELECT TO_DATE ('19000101', 'YYYYMMDD') + 38497.6531944444
    DOUBLE;

    Assuming that it isn't something different right course...

    SQL> ed
    Wrote file afiedt.buf
    
      1  SELECT TO_DATE('19040101', 'yyyymmdd') + 38497.6531944444
      2* FROM dual
    SQL> /
    
    TO_DATE('19040101',
    -------------------
    26/05/2009 15:40:36
    
    SQL>
    

    This would also be a reasonable answer, unless of course your sales/technical design has already stipulated that the float should be the number of days since January 1, 1900.

    However, you don't mention that in your original post, so how could anyone experienced that?

  • variable presentation changing the data type date to string the Calende

    Hi gurus,

    I'm having a strange problem. I have a Start date and end date fast that aren't on any column presentation for example (in the case where 1 = 0 DATE. DATE other cast ('2100-12-31 Date ') end).
    Now, this prompt, I put 2 startdate and enddate variables presentation to use in my sql filter in the report.i use these variable to calculate the date for these 2 end dates and then I apply between it function with these 2 dates.
    The question is when the dashboard is running for the first time the presentation variable takes the dates as the DATE "' 2009/14/10 and when I change the date and click on the go button, the variables is October 15, 2009" as strings anf so DATE in my SQL filter functions fails and error throughts VD.

    All of the suggestions!

    Nico explain already.

    Select date '' 2009-12-15 of the double - TRUE
    Select date of 2009 '-15-12' of the double - ORA-01843: not one month valid
    Select date ' 10/2009/15 ' of double - ORA-01861: literal does not match the format string

    DATE 'yyyy-mm-dd' does that have this format.

    Concerning
    Goran
    http://108obiee.blogspot.com

Maybe you are looking for

  • ZTE open is really supported.

    Its clear that ZTE will not make the changes required for updates so that phone Orange Ebay users will be supported. Updates fail, and users are advised to wait for months.Could we have some sort of credit if we return to these phones for one of thos

  • Safari 9.0.3 performance issues

    Just upgraded to Safari 9.0.3 today. It crashes when loading 90% of all Web sites. Very slow to load Web sites that he ends up by opens.  And even then, there are a lot of missing content. Disappointing to say the least. I disabled all extensions, re

  • Lenovo's Z500 airplane mode function

    Hello I have a Lenovo laptop z500 and the flight mode function key does not work I tried to start in safe mode and safe mode with network but the key does not work either Thank you.

  • Con ayuda para vi control of tiempo

    Hola mi problema are ele siguiente... I need set los tiempo pra prarmetros a process of alimentos Sarten... SE deben set the "Tiempo para el proceso" y el show debe vi. : hora en as inicio el proceso, as regard en hora, y el tiempo passed... as to te

  • How to set up a standalone Aironet AP? 1260 series

    I am new to the Cisco Aironet access point. I got a new AUTONOMOUS Aironet 1260 series access point device. Part # AIR - AP1262N - A - K9. The package came with any guide, CD, and AC adapter. I searched Cisco sites, but found no suitable textbooks. I