Querry Question - Substrings - With Answer Solution

In my database table, there is one field for the employee name in the order of (
LastName,FirstName) Example (Brian,Robbin,D) and I have another field for the Address in order of (City State Zip) Example (Clinton Twp Mi 48045).
Bellow I have a SQL query that actually work but what I need to do is to incorporate into this query where only the LastName is selected and where only the zip code is selected.
I believe I have to write a subtr clause for the zip but how to just select the lastname and not the LastName and full name.
Querry
Select Ballots.FULLNAME,
Ballots.ROWID,
Ballots.DATE_RETURNED,
Ballots.DATE_SENT,
Ballots.APP_RETURNED
from ABSENTEE_BALLOTS Ballots
Where trim(upper(address1)) like trim (upper(:street))|| '%' and trim (upper(address2)) = trim(upper(:zip)) and trim (upper(FULLNAME)) = trim(upper(:name)) and to_char(dob)=:birthDate ||"
Here is the answer bellow:
SELECT AbsenteeBallots.FULLNAME,
AbsenteeBallots.ROWID,
AbsenteeBallots.DATE_RETURNED,
AbsenteeBallots.DATE_SENT,
AbsenteeBallots.APP_RETURNED,
AbsenteeBallots.DOB
FROM ABSENTEE_BALLOTS AbsenteeBallots
WHERE trim(upper(address1)) like trim(upper(:street)) ||'%' and substr (upper(address2),-5,5) = upper(:zip) and substr(upper(FULLNAME), 1,instr(upper(FULLNAME),',')-1) = upper((:name)) and to_char(dob) = :birthDate ||''
Message was edited by:
CindyOnstar

No, you have to compare that substring to something. Right now you are doing a substring and getting everything before the first comma and not comparing it to anything.
SELECT
FROM
    SELECT
       'LAST_NAME, FIRST_NAME' a
    FROM
       DUAL
WHERE
   substr(a, 1, instr(a, ',') - 1);
   substr(a, 1, instr(a, ',') - 1)
ERROR at line 11:
ORA-00920: invalid relational operatorbut this will work 'cause I compare it (hence it's a clause in the where clause)
SELECT
FROM
    SELECT
       'LAST_NAME, FIRST_NAME' a
    FROM
       DUAL
WHERE
   substr(a, 1, instr(a, ',') - 1) = 'LAST_NAME' ;
A
LAST_NAME, FIRST_NAMEBTW, try putting [ code ] before and [ /code ] around your SQL (minus the spaces before/after the [ and ]) to make your SQL easier to read

Similar Messages

  • SD certification questions - Help with answers

    Dear All,
    I am writing my certification exam tomorrow. Please help me in finding the answers for the below questions.
    1. Can i have multiple condition records for a condition table?
    2. Can two condition types share a condition table?
    3. What happens to the value of the condition type which is marked for both the header and the item simultaneosly?
    4. Can an access have multiple condition tables?
    5. Can i specify 2 source fields for a field within a condition table?
    6. Can i change the activation type during the creation of a condition record to a different one thats set up in the condition type?
    7. Where are the tax codes defined? and for which entity/level?
    8. How are tax codes assigned to a country?
    9. Can i create sales deals without reference to a promotion?
    10. Can you do picking in the order? if so how?
    11. What are the possible transportation.plan.stats?
    12. Can the shipment be created automatically?
    13. What happens to the material listing/exclusion if payer is different from sold to party?
    14. Can we do free goods dtermination in deliveries?
    15. When one picks a delivery, does it update the order item status?
    16. Are transportation planning points connected to loading points?
    17. How transportation planning point and shipping point connected?
    18. What are the packets in which SAP transmitts information, called?
    19. Are there any blocks possible at the schedule line level?
    20. Can we enter a sub-item in the higher level item field in the delivery?
    21. Does item category determination in delivery take into account higher level item category also?
    22. Can one condition type have multiple access sequence?
    Regards
    Prasanth

    1. Can i have multiple condition records for a condition table?
    Yes. This is possible as we can maintain future change in price in advance.
    2. Can two condition types share a condition table?
    Yes.
    3. What happens to the value of the condition type which is marked for both the header and the item simultaneosly?
    Item level has precedence.
    4. Can an access have multiple condition tables?
    Yes.
    7. Where are the tax codes defined? and for which entity/level?
    Tax Code are defined in Transaction Code: FTXP
    8. How are tax codes assigned to a country?
    It is done in Excise Setting.
    10. Can you do picking in the order? if so how?.
    No. It is done in Delivery.
    12. Can the shipment be created automatically?
    No.
    13. What happens to the material listing/exclusion if payer is different from sold to party?
    It will be based on Sold to Party.
    15. When one picks a delivery, does it update the order item status?
    Yes.
    19. Are there any blocks possible at the schedule line level?
    Yes. Delivery Block
    22. Can one condition type have multiple access sequence?
    No. It can have only one Access Sequence. Header and Manual Condition Type do not have Access Sequence.
    Regards,
    Rajesh Banka

  • HT201303 How can I reset my security answers ? I do not remember them, and Apple support just can help me if I remember one o more answers. I already have three Follow-ups: 237312883, 374526499 and 239690719 with no solution.

    How can I reset my security answers ? I do not remember them, and Apple support just can help me if I remember one o more answers. I already have three Follow-ups: 237312883, 374526499 and 239690719 with no solution.

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
      1. Go to: Apple Express Lane;
      2. Under Product Categories choose iTunes;
      3. Then choose iTunes Store;
      4. Then choose Account Management;
      5. Now choose iTunes Store Security and answer the bullet questions, then click
          Continue;
      6. Sign in with your Apple ID and press Continue;
      7. Under Contact Options fill out the information and advise iTunes that you would
          like your security/challenge questions reset;
      8. Click Send/Continue.
    You should get a response within 24 hours by email.
    In the event you are unsuccessful then contact AppleCare - Contacting Apple for support and service.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
      a. on the device that is asking you for the security questions go to "settings", > "store" >
          tap the Apple ID and choose view"Apple ID" and sign in.
      b. Tap on payment information and add a credit/debit card of your preference then select
          "done", in the upper right corner
      c. sign out and back into iTunes on the device by going to "settings"> "store" > tap the
          Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you
          should be asked to verify your security code for the credit /debit card and NOT the
          security questions.
      d. At this time you can remove the card by going back in to edit the payment info and
          selecting "none" as the card type then saving the changes by selecting "done". You
          should now be able to use your iTunes store credit without answering the security
          questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • HT201303 I forgot to answer the secret question what is the solution

    I forgot to answer the secret question what is the solution?

    Have you tried the methods described here in this link: Apple ID: All about Apple ID security questions  ?
    If that is impossible for some reason, you need to contact Apple and ask them to help you to reset them, see this webpage on how to contact Apple Support in your country: There are either telephone umbers given or an email form:
         Apple ID: Contacting Apple for help with Apple ID account security
    Explain, that you need help with an account security problem.
    You can also try to email the iTunes Support using this form: https://ssl.apple.com/emea/support/itunes/contact.html
    -- Léonie

  • I got an answer and I replied with a question about the answer, does no show in unanswered

    I got an answer and I replied with a question about the answer, does no show in unanswered questions. I guess replying was not the way to get another anwer, How do I do that?
    He said - Certain Firefox problems can be solved by performing a Clean reinstall. This means you remove Firefox program files and then reinstall Firefox.
    I want to know - Will I still have my bookmarks, history, addons, plugins, etc.? I do not know what plugins and such that I had. What about my pinned tabs and my tabs that where open.
    More information - When I try to start Firefox I keep getting the message that I need to restart my computer in order to complete a previous update attempt. I had Sweetpacks on my PC and I do not know where it came from, it took over my home page in Internet Explorer and Ithink caused the issue with Firefox.
    Should I do the clean install or try starting Firefox now.

    Could you please stay in the thread where you posted the question and reply there instead of opening a new thread?
    Locking this thread, so please continue here:
    *[[/questions/968194]]
    See also:
    *[[/questions/968222]]
    You won't lose bookmarks and other data in the Firefox profile folder as long as you do not remove personal data in case you uninstall Firefox.
    See also:
    *http://kb.mozillazine.org/Profile_backup
    *https://support.mozilla.org/kb/Backing+up+your+information
    You can open the Properties of the Firefox desktop shortcut via the right-click context menu and check the "Compatibility" tab.<br />
    Make sure that all items are deselected in the "Compatibility" tab of the Properties window.

  • I need some more interview question with answer on modeling,reporting.

    i need some more interview question with answer on modeling,reporting.

    Hi,
    You may find tons of topic about interview question. Please try to search forums before opening a post next time.Take a look at the link below.
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bwinterviewquestions&adv=true&adv_sdn_all_sdn_author_name=
    Regards,
    ®

  • HT5312 Ok look these solutions are super complicated and I tried all of them and they don't work I just wanna buy a song ok just one song and it won't let me cause I don't have my questions and a answer from a robot is not going to help me so a real  pers

    Ok look these solutions are super complicated and I tried all of them and they don't work I just wanna buy a song ok just one song and it won't let me cause I don't have my questions and a answer from a robot is not going to help me so a real  person plz

    There are no robots here. Everyone here is a "real person", a user just like you. How about telling us what the problem is that you are experiencing when you try to buy a song? If you mean that you have forgotten your security questions, go to:
    https://appleid.apple.com/
    Click "Manage My Account", sign in, and go to the Password and Security section. If you've forgotten your answers, there should be a link just under the security questions fields where you can have a reset email sent to your Rescue email address. If the link for the email doesn't appear, as can happen if you didn't set a rescue email address or (apparently) have a .Mac email address, see the user tip created by Kappy, another user here, on how to proceed:
    https://discussions.apple.com/docs/DOC-4551
    Regards.

  • Hi, need to verify my account with answers to my security questions, unfortunately I can't remember the answers... I am trying to spend money, do you still want my business?

    Hi, need to verify my account with answers to my security questions, unfortunately I can't remember the answers... I am trying to spend money, do you still want my business?

    colourmesilver wrote:
    ...I am trying to spend money, do you still want my business?
    This is a User to User Forum.
    It is also Your responsibility to remember Your security answers...
    That being said...
    Try this Discussion...
    https://discussions.apple.com/thread/4305745
    And/or see the More Like This section on the right.

  • My secret questions starting with g... mail not belong to me i couldnt change my answers

    my secret questions starting with g... mail not belong to me i couldnt change my answers..
    i use only my apple id mail which is [email protected]

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (103782)

  • I have problem with the security question i forgot it some body tell me they will show down of the question forgot the answering but nothing show help me plz thanks

    I have problem with the security question i forgot it some body tell me they will show down of the question forgot the answering but nothing show help me plz thanks

    The reset link will only show if you have a rescue email address (which is not the same thing as an alternate email address) set up on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down this page to add a rescue email address for potential future use : http://support.apple.com/kb/HT5312

  • HT201363 whenever i want to download an app, they ask me for 3 security questions.  I answer them and then it says "session has timed out".  And then the whole process repeats itself.  How can I download a free app if this keeps coming up?

    Whenever I want to download a free app, it asks me for 3 security questions.  I answer them.  Then it says "session has timed out".  Then the whole process starts over.  How can I get around this?

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • I have a problem in the security question I hope a solution as soon as Lee does not respond change ÓćÇá Secretariat

    I have a problem in the security question I hope a solution as soon as Lee does not respond change ÓćÇá Secretariat

    Welcome to the Apple Community.
    Start here (change country if necessary) and navigate to 'Password and Security', reset your security questions using the link provided, you will receive an email to your rescue address, use the link in the email and reset your security questions.
    If that doesn't help, you don't receive a reset email or you don't have a rescue address, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

  • Everything I buy any application wants me to enter confidential questions and I've forgot and I forgot email alternative to'm doing reset to questions What is the solution?

    Everything I buy any application wants me to enter confidential questions and I've forgot and I forgot email alternative to'm doing reset to questions What is the solution?

    You need to contact AppleCare for assistance.
    Apple ID: Contacting Apple for help with Apple ID account security

  • 9 days and counting with no solution...thanks verizon

    8/24, all three of my tvs start experiencing pixelation where the screens constantly cut in and out along with the sound.  I try the support center provided through the menu section.  I try all trouble shooting methods and none fix the problem.  The next day 8/25 I call verizon customer support for assistance.  The gentlemen that answers has a thick accent that is very hard to understand when he speaks english so I ask to be transferred to someone who speaks english as their primary langauge.  He indicates that it is impossible for him to do that so I hang up and try again with another call. 
    The second call leads to the next technician testing my line and restarting my tv boxes.  This does not fix the problem so we schedule a technician to come out to my house.  The next available time would be from 4-6pm on Wed (8/28).  I was told the technician would call thirty minutes prior to arriving at my house.  About 5:28pm on 8/28 i recieve a text message that my request was closed.  No one ever showed up at my house and my tvs were still not fixed....I call customer support at 5:48 and ask why my request was closed, I was told that the technician found no one at home so he closed the request...I was at home the entire time anxiously waiting his phone call and arrival.  Without explanation I was told my option was to make a new ticket and schedule another day for service...Needing this problem fixed I have no choice but to schedule another service date so the next available is Fri (8/30) from 2-4pm.  I take off work again and sit at my house for two hours.  I recieve a call from a blocked number at 3:35pm on Friday and the call drops.  Minutes later I receive a voicemail notification.  It's the technician telling me that there are multiple requests for service in my neighborhood so my problem is not isolated to my house.  He said they were aware of the problem and would have it fixed soon so there was no need to come to my house.  
    Now to Sunday morning (9/1), the problem is still not fixed so another call is made to customer support.  I tell the technician the problem and the history.  He doesn't seem to listen to what I have told him and tries to give me steps to troubleshoot the problem.(this troubleshooting had been done 3 previous times)  I ask to speak to a supervisor which he does not want to transfer me to.  Eventually he puts me on through to a supervisor who doesn't listen to my actual problem but just assures me that the technician can troubleshoot the issue. (He cannot because I had already tried to troubleshoot the issue with other technicians) 
    So here I am 9 days from when the problem started with no solution.  No management that can take care of my issue or really seem to want to take care of my issue...Directv here I come!

    Hi PleaseJustHelp,
    Your issue has been escalated to a Verizon agent. Before the agent can begin assisting you, they will need to collect further information from you. Please go to your profile page for the forum and look at the top of the middle column where you will find an area titled "My Support Cases". You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
    Under "My Support Cases" you will find a link to the private board where you and the agent may exchange information. This should be checked on a frequent basis, as the agent may be waiting for information from you before they can proceed with any actions. Please keep all correspondence regarding your issue in the private support portal.

  • Re: How can I restore DELETED APPS :- icloud,facebook,twitter on my iPhone 4S?(THE APPS IN QUESTION CAME WITH MY iPhone I DID NOT PURCHASE THEM).These apps are dimmed and not responsive on my phone. I cannot back up to icloud.

    Little fingers have deleted the above mentioned apps!
    THE APPS IN QUESTION CAME WITH MY iPHONE.
    I DID NOT PURCHASE THEM!
    HOW CAN I RESTORE THEM, THEY ARE NOT LISTED IN THE APP STORE????

    Hey Clyde71,
    Thanks for the question. From your description, it sounds like various Account Settings have been greyed out in your Settings application (iCloud, Facebook, Twitter). The cause for these being greyed out is a restriction setup on your iPhone. You'll probably see that Restrictions are turned "On" in Settings > General.
    You'll want to disable the restriction "Allow Changes: Accounts". For more information on restrictions, see this article:
    iOS: Understanding Restrictions (Parental Controls)
    http://support.apple.com/kb/HT4213
    Thanks,
    Matt M.

Maybe you are looking for

  • Smart albums not working with multiple faces

    I have a picture in an event tagged with 2 faces, Chase and Caleb. I setup a smart album with two criteria: 1) Face 'is' Chase, and 2) Face 'is not' Caleb. My smart album includes the photo above, but it shouldn't since I have specified that I want C

  • When I open a new app, it does not appear in the dock.

    After upgrading to mountain lion, apps don't appear on the dock when I open them.  I also am not getting new mail notifications on my mail icon.  I've checked preferences>notifications and everything seems to be right.

  • HR:Anual PF Report

    Hi, While running the annual PF report(PC00_M40_PFY ) for an employee we are getting 2 PF numbers which happed due to wrong uploading.Hence in the form 3A printout the values are flowing in two pages with respect to the two PF numbers.i want these va

  • Simple date format probem

    i wrote a method to convert a String to Calendar, but i have an error. The calendar object generated always has the month set to january and i don´t know why. This is my code      static SimpleDateFormat df=new SimpleDateFormat("yyyy-mm-dd hh:mm:ss")

  • "error when importing object" when selecting variant

    Hello, we recently migrated from 4.6 to 4.7. For some programs, when selecting a variant, this gives a runtime error, like Error when importing object "C131A2" What is the cause of this? Because the values in the variant aren't valid anymore? How can