Vowels and consonants count of a string

Hi...
1.    plz provide code for counting no of  vowels and        Consonants   in a STRING.... suppose the string is BUSINESS.
and also other
2.     program to pass the string during runtime and couting vowels,consonants and also checking whether the string is palindrom or not.
plz send me the code asap...
Regards
Narin.

Hi,
   DATA :  v_string(40) VALUE  'BUSINESS',
              v_cnt1 TYPE I,
              v_cnt2 TYPE I VALUE 1,
              v_len TYPE I,
              v_num(10),
              v_diff TYPE I,
              v_vowels TYPE I ,
             v_conso TYPE I.
START-OF-SELECTION.
  v_len =  strlen( v_string ).
   DO v_len TIMES.
     IF v_string+v_cnt1(v_cnt2)  CA  'A,E,I,O,U'.
        v_vowels =  v_vowels  + 1.
     ELSE.
      v_conso =  v_conso + 1.
     ENDIF.
       v_cnt1 =  v_cnt1 + 1.
   ENDDO.
  WRITE : v_vowels  , v_conso.

Similar Messages

  • Pl/sql block to count no of vowels and consonents in a given string

    hi,
    I need a pl/sql block to count no of vowels and consonants in a given string.
    Program should prompt user to enter string and should print no of vowels and consonants in the given string.
    Regards
    Krishna

    Edit, correction to my above post which was wrong
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '&required_string' as txt from dual)
      2  --
      3  select length(regexp_replace(txt,'([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])|.','\1')) as cons_count
      4        ,length(regexp_replace(txt,'([aeiouAEIOU])|.','\1')) as vowel_count
      5* from t
    SQL> /
    Enter value for required_string: This is my text string with vowels and consonants
    old   1: with t as (select '&required_string' as txt from dual)
    new   1: with t as (select 'This is my text string with vowels and consonants' as txt from dual)
    CONS_COUNT VOWEL_COUNT
            30          11
    SQL>

  • Help Counting Vowels and Consonants using a class

    I'm currently working on a class project where I need take a user inputed string and count how many vowels and/or consonants are in the String at the user discretion. I have the main logic program working fine. However, the trouble I'm running into is how to take the string the user inputed and pass that data into the class method for counting.
    Here is the code for the program:
    package vowelsandconsonants;
    import java.util.Scanner;
    public class VowelConsCounter {
        public static void main(String[] args) {
            String input; //User input
            char selection; //Menu selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Get the string to start out with.
            System.out.print("Enter a string: ");
            input = keyboard.nextLine();
            //Create a VowelCons object.
            VowelCons vc = new VowelCons(input);
            do {
                // Display the menu and get the user's selection.
                selection = getMenuSelection();
                // Act on the selection
                switch (Character.toLowerCase(selection)) {
                    case 'a':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        break;
                    case 'b':
                        System.out.println("\nNumber of consonats: " +
                                vc.getNumConsonants());
                        break;
                    case 'c':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        System.out.println("Number of consonants: " +
                                vc.getNumConsonants());
                        break;
                    case 'd':
                        System.out.print("Enter a string: ");
                        input = keyboard.nextLine();
                        vc = new VowelCons(input);
            } while (Character.toLowerCase(selection) != 'e');
         * The getMenuSelection method displays the menu and gets the user's choice.
        public static char getMenuSelection() {
            String input;  //To hold keyboard input
            char selection;  // The user's selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Display the menu.
            System.out.println("a) Count the number of vowels in the string.");
            System.out.println("b) Count the number of consonants in the string.");
            System.out.println("c) Count both the vowels and consonants in the string.");
            System.out.println("d) Enter another string.");
            System.out.println("e) Exit the program.");
            //Get the user's selection
            input = keyboard.nextLine();
            selection = input.charAt(0);
            //Validate the input
            while (Character.toLowerCase(selection) < 'a' ||
                    Character.toLowerCase(selection) > 'e') {
                System.out.print("Only enter a,b,c,d or e:");
                input = keyboard.nextLine();
                selection = input.charAt(0);
            return selection;
    class VowelCons {
        private char[] vowels;
        private char[] consonants;
        private int numVowels = 0;
        private int numCons = 0;
        public VowelCons(String str) {
        public int getNumVowels() {
            return numVowels;
        public int getNumConsonants() {
            return numCons;
        private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
    }The UML given to me by my instructor calls for the counting method to be private. Being that I'm not too familiar with Java syntax I did not know if that may cause a problem with passing the user's input into that method.

    Well the only compilers i get are due to the code:
    private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
        }However, that is due to the fact that i have no data for those variables to use. I'm pretty much stuck on how to get the string the user inputs into that method shown above so the code can perform the task of counting the vowels and consonants.
    If i comment out the code within that function the program compiles and will allow me to enter the string and use the options but since i can't figure out how to pass the input to the counting method the program returns 0 for everything.

  • Trouble Counting Vowels and Consonants

    Hey I am trying to create a GUI that has three text fields, one for typing letters into it, the other two counts the vowels and consonants. However, I can't get the code to properly spit out any numbers and whenever I type in letters I get an exception: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GUI extends JFrame implements KeyListener {
         public int numberOfConsonents = 0;
         public int numberOfVowels = 0;
         public JTextField jtf1;
         public JTextField jtf2;
         public JTextField jtf3;
         public JLabel jl3;
         public JLabel jl2;
         public GUI(){
         JTextField jtf1;
         JTextField jtf2;
         JTextField jtf3;
         jtf1 = new JTextField(20);
         jtf1.addKeyListener(this);
         jtf2 = new JTextField(5);
         jtf3 = new JTextField(5);
         jl2 = new JLabel("Vowels");
         jl3 = new JLabel("Consonants");
         jtf2.setEditable(false);
         jtf3.setEditable(false);
         getContentPane().setLayout(new GridLayout(2,3));
         getContentPane().add(jtf1);
         getContentPane().add(jl2);
         getContentPane().add(jtf2);
         getContentPane().add(jl3);
         getContentPane().add(jtf3);
         public void keyPressed (KeyEvent ke){
              char c = ke.getKeyChar();
              if (Character.isLetter(c)){
                   c = Character.toLowerCase(c);
                   if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
                        numberOfVowels++;
                        jtf3.setText(""+numberOfVowels);
                   else{
                        numberOfConsonents++;
                        jtf2.setText(""+numberOfConsonents);
              validate();
    //      not used
         public void keyReleased (KeyEvent ke){
         // not used
         public void keyTyped (KeyEvent ke){
         public static void main(String args[]){
              GUI gui = new GUI();
              gui.pack();
              gui.setVisible(true);
              gui.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    In your constructor, don't re-declare the JTextFields. Essentially...
         public GUI(){
         jtf1 = new JTextField(20);
         jtf1.addKeyListener(this);
         jtf2 = new JTextField(5);
         jtf3 = new JTextField(5);
         jl2 = new JLabel("Vowels");
         jl3 = new JLabel("Consonants");
         jtf2.setEditable(false);
         jtf3.setEditable(false);
         getContentPane().setLayout(new GridLayout(2,3));
         getContentPane().add(jtf1);
         getContentPane().add(jl2);
         getContentPane().add(jtf2);
         getContentPane().add(jl3);
         getContentPane().add(jtf3);
         }The reason it's making an error is because you never construct the GLOBAL JTextFields. To access a JTextField globally, if you already have a JTextField with the same name in some method, you have to use this.theNameOfTheThing .

  • How can i compare in percentage, vowels and consonants in english and german language?

    how can i compare in percentage, vowels and consonants in english and german language?

    Hi,
    Try comparing the Unicode value of the characters, see the code samples in these threads:
    Generating unicode
    for arabic character similar to Character map in c#
    How
    do you get the numeric unicode value of a  character?
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Counting Vowels and Consonants...

    Hellos All,
    I have the following
    import java.util.Scanner;
    public class r3
    public static void main(String[] args)
    //declare variables
    String userInput, workString = "";
    int stringLength;
    int numberVowels = 0;
    char userChoice;
    Scanner keyboard = new Scanner(System.in);
    char[] vowelArray = {'a', 'e', 'i', 'o', 'u'};
    boolean enterAString;
    System.out.println("Would you like to enter a string");
    enterAString = keyboard.nextBoolean();
    //user input
    while(enterAString)
    {//begin loop
    System.out.println("please enter a string");
    userInput = keyboard.nextLine();
    userInput = userInput.toLowerCase();
    stringLength = userInput.length();
    for(int i = 0; i < stringLength; ++i)
    if((int)userInput.charAt(i) >= 97 && (int)userInput.charAt(i) <=122)
    workString = workString + userInput.charAt(i);
    for(int i = 0; i < stringLength; ++i)
    if(userInput.charAt(i) >= 'a' && userInput.charAt(i) <= 'z')
    workString = workString + userInput.charAt(i);
    System.out.println(workString);
    System.out.println("Please select\n"
    +"a for number of vowels\n"
    +"b for number of consonents\n"
    +"c for number of vowels and consonents\n"
    +"d to enter another string\n"
    +"e to exit\n");
    userChoice = ((keyboard.nextLine()).toLowerCase()).charAt(0);
    System.out.println(userChoice);
    //determin number of vowels
    for(int i = 0; i < workString.length(); ++i)
    for(int j = 0; j < vowelArray.length; ++j)
    if(workString.charAt(i) == vowelArray[j])
    numberVowels++;
    switch(userChoice)
    case 'a':
    System.out.println("The number of vowels is: " + numberVowels);
    break;
    case 'b':
    System.out.println("The number of consonents is: " + (workString.length() - numberVowels));
    break;
    case 'c':
    System.out.println("The number of vowels and consonents is: " + workString.length());
    break;
    case 'd':
    break;
    case 'e':
    enterAString = false;
    break;
    default:
    System.out.println("Invalid input. Goodby.");
    }//end switch
    }//end loop
    System.out.println("Thanks for playing");
    }//end main
    }//end classSo far it somewhat works fine, but for the number of consonents when printed. The number printed out is not equal to the string input by the user. The bigger the string gets the bigger the difference in the amount of consonants.
    any help would be appretiated thanks

    you can do this very easily by using 2 replace alls.
    String userInput = ...
    String pureText = (userInput.toLowerCase()).replaceAll("[^a-z]", "");
    String vowels = pureText.replaceAll("[^aeiou]", "");
    int vowelCount = vowels.length();
    int consonantCount = pureText.length() - vowelCount;

  • Proxy Visiting URL and Hit Counter

    When i connect and download a url using java it doesnt add one to the javascript hit counter on that site, whats wrong ? here is my code :
    import java.util.Properties;
    import java.util.Date;
    import java.net.URL;
    import java.net.URLEncoder;
    import java.net.HttpURLConnection;
    import java.net.URLConnection;
    import java.io.*;
    import java.util.*;
    // This is a simple example that shows how to get HTTP connections to work
    // with a proxy server. If all goes well, we should be able to post some
    // data to a public cgi script and get back the resulting HTML. If anyone
    // knows some "gotchas" when combining Java and proxies, I'd love to hear
    // about them. Send your thoughts to [email protected].
    public class RunProxy
        static String proxy;
        static String port;
        static String url;
        public RunProxy (String url1, String proxy1, String port1)
            proxy = proxy1;
            port = port1;
            url = url1;
            System.out.println ("Proxy Used:");
            System.out.println (proxy);
            System.out.println ("Port Used:");
            System.out.println (port);
            System.out.println ("Url Used:");
            System.out.println (url);
            //proxy = "195.61.75.183";
            System.out.println (proxy);
            main (new String [0]);
        public static void main (String argv [])
            try
                System.out.println ("Does this come after ? ");
                // Enable the properties used for proxy support
                System.getProperties ().put ("proxySet", "true");
                System.getProperties ().put ("proxyHost", "" + proxy);
                System.getProperties ().put ("proxyPort", "" + port);
                char doubleBrackets = '"';
                Calendar calendar = Calendar.getInstance ();
                String seconds = "" + calendar.getTimeInMillis ();
                seconds = seconds.substring (0, 10);
                // URL to a public cgi script
                System.out.println (seconds);
                //            URL url = new URL ("http://www.outwar.com/page.php?x=889751/&tom=" + seconds + "&tom_ench=d23bb6ce525d19b409977e39a298049e&pro=761b4f72a39bfbbbe7a556fa6cd41aa1&r=&h=25e7ec84cd9a43ff95a7c0393468f582&wid=" + doubleBrackets + "+wid+" + doubleBrackets + "&hit=" + doubleBrackets + "+ hit +");
                String url2 = url;
                //url2 = "http://missions.itu.int/~italy/old%20files/visitors.htm";
                URL url = new URL (url2);
                // URL url = new URL ("http://google.ca/");
                //URLConnection connection = url.openConnection ();
                HttpURLConnection connection = (HttpURLConnection) url.openConnection ();
                connection.setFollowRedirects (true);
                connection.setInstanceFollowRedirects (true);
                connection.setDoInput (true);
                connection.setDoOutput (true);
                // enter the username and password for the proxy
                String password = "vishu:vishwajeet";
                // base64 encode the password. You can write your own,
                // use a public domain library like
                // http://www.innovation.ch/java/HTTPClient/ or use
                // the sunw.server.admin.toolkit.security.BASE64Encoder
                // class from JavaSoft Java Web Server.
                //String encoded = base64Encode( password );
                String encodedPassword = "Basic " + new sun.misc.BASE64Encoder
                    ().encode (password.getBytes ());
                // Set up the connection so it knows you are sending
                // proxy user information
                connection.setRequestProperty ("Proxy-Authorization", encodedPassword);
                // Set up the connection so you can do read and writes
                connection.setDoInput (true);
                connection.setDoOutput (true);
                /*// open up the output stream of the connection
                DataOutputStream output = new DataOutputStream(
                connection.getOutputStream() );
                // simulate a POST from a web form
                String query = "name=" + URLEncoder.encode(
                "Ronald D. Kurr" );
                query += "&";
                query += "email=" + URLEncoder.encode( "[email protected]" );
                // write out the data
                int queryLength = query.length();
                output.writeBytes( query );
                output.close();*/
                // get ready to read the response from the cgi script
                DataInputStream input = new DataInputStream (
                        connection.getInputStream ());
                // read in each character until end-of-stream is detected
                try
                    PrintWriter output = new PrintWriter (new FileWriter ("tempPage2.txt"));
                    for (int c = input.read () ; c != -1 ; c = input.read ())
                        output.print ((char) c);
                    input.close ();
                    output.close ();
                catch (Exception heea)
                    System.out.println (heea);
                System.out.println ("UR GOOD!, next run. ");
            //suicide
            catch (Exception e)
                System.out.println ("Something bad just happened.");
                System.out.println (e);
                e.printStackTrace ();

    if your going through a proxy your gonna be hitting the server with the same ip address each time right? Don't some/most counters count unique IP address hits?

  • Find and replace value in Delimited String

    Hi All,
    I have a requirement, where i need to find and replace values in delimited string.
    For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
    I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
    I just wanted to know if there is any better way to do it?

    for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
    with testdata as (
    select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}') part
    ,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}')
             ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
    FEB
    02/01/2013
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    with year included
    with testdata as (
    select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
    ,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
             ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    JAN-13
    01/01/2013
    GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
    Message was edited by: chris227 year included

  • Hey How Do I Get Group Message On The IPhone 4s because some reason it doesn't want to show . First i did is setting then messages  it only show imessage and message count )HELP)

    ey How Do I Get Group Message On The IPhone 4s because some reason it doesn't want to show . First i did is setting then messages  it only show imessage and message count )HELP)

    At the bottom of the page Settings > Messages you should have a section headed "SMS/MMS" Turn MMS messaging on then you can turn group message on.

  • How can I import playlists, ratings, and play counts from an old iTunes library into a new one?

    After reading countless threads re: how to get the iTunes artwork screensaver to work, I decided to delete my iTunes library file and reimport all of music which resulted in fixing the iTunes artwork screensaver.  Unfortunately (and expectedly), my playlists, playcounts, and other information were lost with the creation of a new library.  Is there any way to import the playlists, ratings and play counts for my music from an old library file to my current one?  I realize this may be complex, but I'm up for the task.
    Thanks in advance,
    B

    I can't begin to describe how frustrating the screensaver issue has been for me (and I suspect countless others, judging by the number of threads on the topic). 
    I took your advice, though, just to test it.  After backing up my current library.itl, I copied and pasted the old .itl file into its place.  As expected the playlists, play counts, etc were instantly restored.  And now the screensaver fails to work with the dreaded error 'No iTunes artwork found' which makes me think it IS an issue with the old library file.  The only work around I've seen so far is to rebuild the library (which I did). 
    I'm afraid I'm going to be forced into choosing either a working screen saver or all my itunes data.  Very frustrating indeed.
    Here's a link to the 'definitive' fix for the screensaver, if you're interested.
    https://discussions.apple.com/thread/3695200?start=0&tstart=0
    Thanks again,
    B

  • How can I display special characters of NonEuropean languages (French, Italian, Spanish, German and Portuguese.) using import string mechanism

    I would like to translate the User Interface of my application to French, Italian, Spanish, German and Portuguese.
    When I put special characters in the import string file they showed up as ? (question mark)
    The import strings file includes the following parameters for each string: font, text, size and style. (but no field for script)
    In order to use a unicode font such as Arial I need to select a french script. But this option is not supported bu LabView (As far as I saw)
    A) Is there a font which is directly German/ French etc and not regula font + script parameter?
    B) Are there another required step
    s for special characters support? (When I put speciual characters in the import string file the showed up as ? question mark)

    This was discussed last week in this group- read the previous messages.
    Look for the thread "Foreign Languages in Labview"
    And recite the mantra
    ActiveX is good
    ActiveX is holy
    All Hail Bill
    Those who claim otherwise are heretics and not to be trusted
    Actually, in this case the non-ActiveX suggestions may be good.
    talia wrote in message
    news:[email protected]..
    > How can I display special characters of NonEuropean languages (French,
    > Italian, Spanish, German and Portuguese.) using import string
    > mechanism

  • Ordering of objects by more than one field and get counts

    i have an object visit (personid, city, street, place, date)
    A person could have visited a same place in the same strret in the same city several times on different dates.
    I have a visits 'Set' for a person and I have to get a count of visits he has done to a place..
    its basically select count(visits) group by city, street , place.
    I know to use interface comparator for a single field.. how to compare multiple fields and get counts??
    if you know abt where i can find information please let me know.
    Thanks.

    For multiple fields, your comparator compares the most significant field first. If they're unequal, it returns +/- accordingly. If they're equal, then it moves on to the next field. And so on, until, finally, if all the relevant fields are equal, then the objects are equal.
    Just like what you do when comparing, say, last names. If the first letters are unequal, you're done, else move onto the next letter, and so on..
    For the count, you wouldn't use a comparator, as that's for sorting. Exactly how you do it depends on the details of what you're storing and how, which you haven't provided.

  • 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 want to move the location of my iTunes library music files. At present they are all on my time machine . I want to move them all to my imac. Can I do that and keep all my playlists and play counts? Thanks in advance

    I want to move the location of my iTunes library music files. At present they are all on my time machine . I want to move them all to my imac. Can I do that and keep all my playlists and play counts? Thanks in advance
    its 1000s of songs . Originally I used the time machine as a networked drive but it can cause the songs to pause so I'm thinking it would be better to have the songs on the internal imac drive
    how can I move the songs so I can re-open iTunes and the playlists (with plays in the 100s) find the song in the new place?

    Do you mean on your Time Machine backup drive? Or are you actually accessing the backup? In either case you shouldn't be doing that. If you haven't space on your HDD to store the iTunes Library, then at least put it on another external drive.
    Since you did not provide any information about what's actually "on my time machine," here's what you would do. The entire iTunes folder should be stored in the /Home/Music/ folder. Within that folder you would have three folders: imm Media, iTunes, and iTunes Playlists.

  • 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

Maybe you are looking for

  • Is this the best way to Triple Boot?

    Hi all, I have a had a pickle of a time setting up Leopard...with my triple boot setup. I am curious if I went about it "properly"or if there is a better way. Use instructions at your own peril if you wish. I am not responsible for errors or any prob

  • Hello, I'm installing windows xp on my mac with bootcamp.

    the problem is when I reboot the mac and when I have to choose the operating system PC does not recognize my keyboard ... why? now I can not install the drivers for the keyboard because as soon as I turn on the mac I open the installation of windows,

  • Duplicates in Tax Model per BSI

    How do I find and correct Duplicates in the Tax Model/Tax Combos?  I have received BSI error 1401 in four states (CA, AZ, DE, MS) and have been told that I have "duplicates" but I have no idea how to identify the duplicate(s) in question.

  • COPA EXTRACTION---BASICS TO ADVANCE

    HI GURUS, I AM NEW AND PRACTISING COPA EXTRACTION. SORRY I AM EDITING IT FOR MORE CLARITY. I KNOW THAT THEIR R CHARCTERSTICS CHARCTERSTICS VALUES VALUE FIELDS SEGMENT LEVEL SEGMENT TABLE HOW THEY R LINKED TO EACH OTHER-- BECOZ WHEN I COMPLETE THE SEL

  • How to combine records using SQL?

    If I have the following data: Table A order_no company_code O001 C001 Table B order_no po_no O001 P001 O001 P002 O001 P003 Now, I want to combine the data as: View A order_no company_code po_no O001 C001 P001, P002, P003 If can it be realized using S