Newbie question :- An IN statement question

I have the following issue.
I want to use an IN statement (As below), This will enable the user to enter upto 5 serial numbers.
select col.contract, col.order_no, col.customer_no, ci.name Customer_Name, odn.ship_address1, odn.ship_address2, odn.ship_zip_code, odn.ship_city, odn.ship_county, co.customer_po_no, col.part_no, col.catalog_desc Description, ith.serial_no,
col.real_ship_date Ship_Date
from
customer_order_line col,
customer_info ci,
inventory_transaction_hist ith,
customer_order co,
customer_order_deliv_note odn
where
col.customer_no = ci.customer_id
and
col.contract = ith.contract
and
col.order_no = ith.order_no
and
col.part_no = ith.part_no
and
col.order_no = co.order_no
and
col.contract = co.contract
and
col.contract = odn.contract(+)
and
col.order_no = odn.order_no(+)
and
ith.serial_no IN ('&S1' , '&S2' , '&S3' , '&S4' , '&S5')
and
(('&FROM_DATE') is null or ('&TO_DATE') is null or
dated between to_date('&FROM_DATE','DD/MM/YYYY') and to_date('&TO_DATE','DD/MM/YYYY') + ( 1 - 1/ ( 60*60*24 )))
The problem is that if they don't enter any serial numbers it return no values.. (it should do).. How can I I amend this SQl so if S1/2/3/4/5 has null values it does return some data
Message was edited by:
HoLy_PiLgRiM

Hi,
Well it will return customer order's, If I took out the IN statement and run it.. it will promt me for a date range and it will return a load of Customer Orders within that date range..
With the IN statement, If I put a serial number and and specify a date range it will only bring back customers orders with that serial number in them.. The problem is if they don't specify a serial number and enter a date range nothing comes back ? It like I need to enter and if null blah blah

Similar Messages

  • Questions on Room State

    Hey guys,
         I got some questions on room state:
         1) Does the room state actually take some effect or just an indicating flag? For example, if a room state is ROOM_STATE_ENDED, will it prevent any incoming user connection?
         2) I tried to login as a guest, the room setting is HostNotArrived. Then I logged in as an owner. The state was switched to Active. The result seems fine until now. However, when I quit the owner app by closing the brower tab, and checked the quest page, the room state was still in Active, rather than switch back to  HostNotArrived or any other state. Is it an expected result? How can I let the room state update to date if the owner quit in this way?
         3) For my scenario, I'd like to build a room only avaiable when owner arrived. That is, if a guest arrived before the owner arrived or after the owner left, he will not be allowed to do anything , even the connection should be rejected. Is that possible?
         Thanks a lot!
    Jinni

    Hi Jinni,
      1) It should prevent any incoming connection other than OWNERs of the room.
      2) HostNotArrived happens only before a room has been "kicked off" by the owner, and not afterwards (even if the owner has left the room, it's still fair to say he had "arrived").
      3) I'm not sure there's a perfect way to do this yet. We'll be looking into this use case, which feels like you need some "server-to-server" integration : the ability to detect an owner has left, then a way to shut down the room. Does that seem right to you? For now, a quick way of achieving the functionality (if not the security) is to have your clients detect that there's no owner, and disconnect.
       hope that helps
       nigel

  • Question about 'write' statement

    Hi,
    A question on write statement.
    I have a internal table itab which has field var. I am looping at this itab and writing horizontal heading output like below.
    example on the output heading:
    (3 spaces) itab-var (20 spaces) itab-var (20 spaces) itab-var.
    the coding is:
    loop at itab.
    write: 3 itab-var.
    endloop.
    I want to increase the space by 20 for every loop. How to increase this 3 by 20? Can we accomplish this way?
    Thank you for your time.

    hi krishen,
    just add 20 inside the loop , so that after every loop its value increases by 20
    for example:
    data: v  type i.
    v=3.
    do 3 times.
    write: at v(20).
    v=v+20.
    end do.
    hope it will help you
    regards
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 4, 2008 7:47 AM

  • Question about delete statement

    I have question about delete statement...
    i am performing some simple delete statement against one table..but its taking so long..How can we check whether particular delete statements actually deleting records or not..?

    Is the associated select-statement returning rows or not?
    If yes -> delete is deleting
    If no -> delete is just using CPU-cycles
    To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ...

  • UNDO stat Question?

    I am reposting my previous question regarding undo stats in more clear format.
    I need a sql which should display the last 7 undo stats in the following format.
    parameter day1 day2 day3 day4 day5 day6 day7
    sum(undotbs) 100 200 300 400 500 600 700
    sum(txncount) 100 180 280 300 400 500 200
    max(maxquerylen) 200 150 300 120 120 230 340

    I think Daniel's answer in this thread says it all.
    UNDO stat ?

  • Can a file be password protected using Adobe Acrobat XI Standard?  No one seems to have answered this question in the trending questions.

    I just purchased Adobe Acrobat because it was recommended to password protect files.
    However, when I checked out the Tools > Protection > Encrypt>  "Encrypt with Password" is greyed out.
    Can a file be password protected using Adobe Acrobat XI Standard?
    The OS version is Windows 7.
    No one seems to have answered the question in the Trending Questions.
    Thanks.

    Yes, it can.  Use File > Properties, and click the Security tab. Click Change, and set what you need. When the file is saved, the security is set.
    BE SURE TO KEEP THE ORIGINAL FILE TOO.

  • How to make a question pool with MANY questions?

    I would like to make a question pool
    with several thousand questions, which I currently have in an
    Excel file. Is there a way around having manually to enter all
    questions in a Captivate question pool?
    Thanks.

    I would use the XML function from Captivate 4.
    - Make yourself a test quiz with two slides, one being a multiple choice.
    - Export it to XML
    - Open the XML File in Excel
    Good point to start with is ns1:g and ns1:Source26.
    Most likely you can get all your question into captivate that way.
    Mr_TD

  • HT5312 i do not see the Rescue email link under the security questions to reset the questions and answer

    i do not see the Rescue email link under the security questions to reset the questions and answer ?

    You need to contact Apple, either through the link in that article or by phoning them and asking for the Account Security team.
    (82021)

  • HT201363 my id is blocke I answered security question too many wrong questions and i dont have rescue email plz help

    my id is blocke I answered security question too many wrong questions and i dont have rescue email plz help

    hi. i forget the answer of my security question and i dont have an rescue email. how i can change it? please help me. and now im in Iran and i cant call too security team . please help me.
    ipad
    iphone

  • HT5622 i want to change my security questions.but the security questions reset is on an other email e dont know the email... how can i put a other email so i can reset it?

    i want to change my security questions.but the security questions reset is on an other email e dont know the email... how can i put a other email so i can reset it? and i got money on it

    If you don't have access to your rescue email account (you won't be able to change it until you can answer 2 of your questions) then you will need to contact iTunes Support or Apple : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • "My Questions" still lists my question "unresolved" AFTER it got "solved"

    2-12-06
    I marked the reply as having "solved" my question, but the
    "My Questions" reminder still lists my question as "unresolved".
    Perhaps because I sent a reply to the person that replied to my
    question?
    BillJones1 (Appleworks forum/"Boolean search"/2-12-06)
    Thanks
    eMac G4 (build 7W98) 125 GHz, 256 MB, 37 GB   Mac OS X (10.3.9)   dialup 56KB modem

    Hi, Bill -
    In addition to marking the specific reply as "Solved", at the top of the thread (above your initial post asking the question) should be a box (the one I just checked on is pale-blue). In that box is a choice to mark the qustion as "answered". Click that. In the new screen is a place to add an additional comment (you do not need to add one) and a Mark as Answered button - click that button.
    That will clear the question from the list in the sidebar, although it may take some time (and perhaps a log out and back in) in order to have it actually disappear from the display.

  • HT5312 I want buy Apps but need security questions,i forgot security questions and i forg reset security info email address. how can i do.  I know my ID and passworld

    I want buy Apps but need security questions,i forgot security questions and i forg reset security info email address. how can i do.  I know my ID and passworld
    i cant rember questions and my reset security info email(address and passworld)
    How can i do? i want buy apps but need ask this questions.......

    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.

  • My company is interested in ES4, but we have questions. Do all questions get posted here, or is there a sales rep to talk to?

    My company is interested in ES4, but we have questions. Do all questions get posted here, or is there a sales rep to talk to?

    You can post your questions here or if you provide a private message with the company name and location I can get you in touch with the appropriate person

  • Java Newbie Question - the import statement

    Hi Geeks,
    I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent directory of "src" (i.e. at the root of the project). Inside this jar archive, two classes (.class files) are not placed inside a package (default package according to eclipse), let's name one toto.class. So when I want to import toto.class from a file inside the src directory I simply do "import toto.class" but this statement doesn't work ! I don't manage to import my toto.class so ... what do you propose for this ?
    Thanks.

    Don't use the "default" class for anything serious;
    you can't import such a class.Er, package maybe?Yes, I was editing my reply while you replied to my reply so I couldn't
    edit my little blooper in my reply anymore; thank you very much Sir ;-)
    kind regards,
    JosI entered that response as quickly as I could, for just that reason. I
    thought you might notice and try to correct it, and I wanted to preserve
    your fuckupus maximus for all eternity.
    Everyone gather round and taunt Jos! Wave your private parts at his
    auntie! Fart in his general direction!
    Now, aren't you glad you didn't say "Jehovah"?I already knew that you were the one who invented amiability ;-)
    kind regards,
    Jehov^H^H^H^Hos

  • Newbie question about switch statement

    Lets say you have a loop and inside the loop you have a switch statement, how do you BREAK out of the outer loop?
    for (i=0....) {
    switch {
    case 11:
    .... some stuff
    break; <==== HOW DO I BREAK OUT OF THE for loop here?

    In standard C and standard C++ the break statement terminates the nearest enclosing loop and only that loop; i.e. control transfers to the first statement following the loop. I think there are C or C++ extensions that allow loop tags which may be used with a break to specify which loop to drop through, but I don't think these are supported by gcc, and they would certainly be very non-portable.
    There are several common ways to drop out of one or more outer loops. In many cases, there's nothing else in the loop following the switch so you can simply write
    switch (condition) {
    default:
    case 0:
    break;
    // other case statements here
    break;
    Else you can declare a loop control var and use the continue statement like this:
    for (i=0; i<jMax && !bDone; i++) {
    switch (condition) {
    default:
    case 0:
    bDone++; continue;
    // other case statements
    If you need to escape several loops and/or don't want to use loop control vars, you might consider structuring the code so you can use return to terminate the entire function. In the worst case of a very complex structure that you don't know how to simplify with a helper function, you can always resort to a goto:
    switch (condition) {
    default:
    case 0:
    goto escape;
    // other case statements here
    // remainder of code inside nested loops here
    escape: <first statement following the outermost loop>;
    Note that the statement following the escape label is always executed; i.e. when execution skips the goto it's as if the statement following escape was unlabeled. Use goto sparingly of course, since it's an artifact of unstructured programming. But when you really need a goto, it can make your code much easier to maintain.

Maybe you are looking for