SQLQuery and Where-Statement

Hi,
I need a possibility to enter the where-statement at runtime.
In the "SQL Query Statement" I can enter a query and parameters.
My Problem ist that at runtime my forms-application builds the where-Part of the sql-statement and then sends it to the report.
I know that reports has the &where_clause option.
In &where_clause I can enter the whole where-clause of every statement.
But how can I "tell" reports that it's query should based on this &where_clause???
In other words: can I set the "sql Query Statement" at runtime?
Thank you for your help
bye
Florian

Hi Florian,
In the data model, you can create a user parameter "P_WHERE" varchar2(1000), set your query like this:
select col1,...coln
from table
where &P_WHERE;
At the run time, you should pass the Where value from
your form_application and send it to the parameter P_WHERE
of the report.
Hope this helps,
CB

Similar Messages

  • Difference between Check and where statement.

    Hello everybody i know that where clause is efficient than check condition.
    But i want to know if in the following example,
         even after finding SBOOK_WA-CARRID = 'LH' ,
    DOES THE CHECK CONDITION TERMINATES?? OR KEEP SEARCING TILL THE END OF INTERNAL TABLE?
    IN THE 2nd EXAMPLE,
    DOES THE WHERE CLAUSE EXHIBIT THE SAME PHENOMENON?
    1st example:
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    2nd example:
    SELECT * FROM SBOOK INTO SBOOK_WA
      WHERE CARRID = 'LH' AND
            CONNID = '0400'.
    ENDSELECT.

    Hi,
      Check statement will give low performance compare to where.
    B'cause After selecting the record for database table you are checking the value.
    WHERE: At the time of selection records from table you are checking. So based on condition record will select otherwise it will go for nect record with that database connection only.
    In first example. : It will terminate the selection.No next search...
    Second : it will continue the search....

  • Where clause with a combination of And and Or statements - Basic question

    Hi,
    I have a where clause with a combination of And and Or statements... May I know which one would run first
    Here is the sample
    WHERE SITE_NAME = 'Q' AND ET_NAME IN ('12', '15') AND TEST_DATE > DATE OR SITE_NAME = 'E' AND ET_NAME IN ('19', '20')
    can you please explain how this combination works
    Thanks in advance

    Hi,
    This reminds me of a great story. It's so good, it probably didn't really happen, but it's so good, I'm going to repeat it anyway.
    IBM once had an "executive apptitude test" that they would give to job applicants. There were some questions you might call general knowlege or trivia questions, and each question had a weight (for example, answering an unimportant queestion might score one point, an important question might be 5 points.) One of the questions was "What is the standard width of a mobile home?", and the weight of the question was -20: answering the question correctly did serious harm to your score. The reasoning was that the more you knew about mobile homes, the less likely you were to be their kind of executive.
    Now, as to your question, the correct answer is: I don't know. I don't want to know. Mixing ANDs and ORs without grouping them in parentheses is a really bad idea. Even if you get it right, it's going to confuse the next person who has to look at that code. Use parentheses to make sure the code is doing what you want it to do.
    If you really want to find out, it's documented in the SQL language manual. Look up "Operators, prcedence"
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/operators001.htm#sthref815
    You can easily do an experiment, using scott.emp, or even dual, where
    WHERE  (x AND y)
    OR      zproduces different results from
    WHERE   x
    AND     (y OR z)

  • How and where to modify the BAI File for Electronic Bank Statement

    HI,
    Can anybody explaing me How and where to modify the BAI File for Electronic Bank Statement.
    thanks
    Sap Guru
    kischowdary--gmail.com

    Hi
    Actually there were two formats BAI & BAI2, BAI2 format is latest one.
    Please ask for the latest file from bank and try to process.
    Thanks
    Kalyan

  • What is Apple's mission and vision statement? Where can I find it?

    I've thoroughly searched the Apple website for their mission and vision statement. And I have still not found it anywhere. Please help, as I am writing a paper about the organization as a whole.

    "Apple is committed to ensuring the highest standards of social responsibility in everything we do. The companies we do business with must provide safe working conditions, treat employees fairly, and use environmentally responsible manufacturing processes wherever Apple products are made. "
    "To produce high-quality, low cost, easy to use products that incorporate high technology for the individual. We are proving that high technology does not have to be intimidating for noncomputer experts."
    http://www.devdaily.com/blog/post/mac-os-x/apple-business-philosophy-mission-sta tement
    http://features.blogs.fortune.cnn.com/2009/01/22/the-cook-doctrine-at-apple/
    Tim Cook: said this last year during a conference call with investors:
    "We believe that we are on the face of the earth to make great products and that's not changing. We are constantly focusing on innovating. We believe in the simple not the complex. We believe that we need to own and control the primary technologies behind the products that we make, and participate only in markets where we can make a significant contribution. We believe in saying no to thousands of projects, so that we can really focus on the few that are truly important and meaningful to us. We believe in deep collaboration and cross-pollination of our groups, which allow us to innovate in a way that others cannot. And frankly, we don't settle for anything less than excellence in every group in the company, and we have the self-honesty to admit when we're wrong and the courage to change. And I think regardless of who is in what job those values are so embedded in this company that Apple will do extremely well." (Source).

  • I have thousands of songs dowloaded from my cds and purchased from itunes that will not play.  It states the file cannot be found.  What happened to them and where are they?

    I have thousands of songs dowloaded from my cds and purchased from itunes that will not play.  It says file cannot be found.  What happened and where are they?

    When songs cannot be found, it's either because they have been moved from the original location that you told iTunes, renamed or deleted.
    So have you:
    renamed songs?
    moved them to a different loaction on your computer since you imported them into itunes?
    deleted them since you imported them?
    stored you iTunes library on an external drive? If so, that drive needs to be on and ready every time before you start iTunes.
    ... or is another programme renaming or even moving them, such as Windows Media Player? (It has been known to if you let it.) Did you previously use Windows Media Player?

  • What is difference between sy-index and sy-tabix and where both are using ?

    what is difference between sy-index and sy-tabix and where both are using ?

    hi nagaraju
    sy-tabix is in Internal table, current line index. So it can only be used while looping at the internal table.
    sy-index is in Loops, number of current pass. This you can use in other loop statements also (like do-enddo loop, while-endwhile)
    SY-INDEX is a counter for following loops: do...enddo, while..endwhile
    SY-TABIX is a counter for LOOP...ENDLOOP, READ TABLE...
    Here is an example from which you can understand the difference between sy-tabix and sy-index.
    Itab is an internal table with the following data in it.
    id Name
    198 XYZ
    475 ABC
    545 PQR.
    loop at itab where id > 300.
    write :/ itab-id, itab-name , sy-tabix, sy-index.
    endloop.
    My output will be :
    475 ABC 2 1
    545 PQR 3 2
    Sy-tabix is the index of the record in internal table.
    sy-index gives the no of times of loop passes.
    So, for the first record in the output (475 ABC), 2 is the index of the record in internal table and as it is first time loop pass occured, sy-index value is 1.
    Regards,
    navjot
    award points

  • Query WHERE statement to compare db record date pt 2

    I'm sorry, I hit the answered button on my last post. I didn't mean to. I have been working on this code and have gotten closer to the solution. I just need to tweek out the WHERE statement to get rid of the time from the output, and I believe my cfif needs a little work to allow it to be taken into the actually dates. I cfdumped my variables from my query and finally got an output and not an [empty string]. This is my code now, and I will leave in the cfdump and abort tags so you can see where I put them:
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate Between #NextMonthYear# and #NextMonth# AND eventDate >= #dateFormat(Days, 'dd')#
    </cfquery>
    this is my cfif stement
    <cfoutput query="CaleventRec">
    <cfdump var="#eventDate#">
    <cfabort>
    <cfif Days EQ '#eventDate#'>
    <a href = "detail.cfm?id=#ID#">#Days#</a>
    </cfif>
    </cfoutput>
    this is the whole code:
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate Between #NextMonthYear# and #NextMonth# AND eventDate >= #dateFormat(Days, 'dd')#
    </cfquery>
                            <!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
                            <cfset ThisDay = 0>
                            <!--- Loop through until the number of days in the month is reached. --->
                            <cfloop condition = "ThisDay LTE Days">
                                <tr>
                                <!--- Loop though each day of the week. --->
                                <cfloop from = "1" to = "7" index = "LoopDay">
                                <!--- This turns each day into a hyperlink if it is a current or future date --->
                                  <cfoutput query="CaleventRec">
              <cfdump var="#eventDate#">
                                   <cfabort>
              <cfif Days EQ '#eventDate#'>
                                   <a href = "detail.cfm?id=#ID#">#Days#</a>
                                   </cfif>
              </cfoutput>
                                <!---
                                    If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
                                    If the values match, set ThisDay to 1.
                                    Otherwise, the value will remain 0 until the correct day of the week is found.
                                --->
                                    <cfif ThisDay IS 0>
                                        <cfif DayOfWeek(ThisMonthYear) IS LoopDay>
                                            <cfset ThisDay = 1>
                                        </cfif>
                                    </cfif>
                                <!---
                                    If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
                                    the day of the mnth and increment the value.
                                --->
                                        <cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
                                        <cfoutput>
                                        <!--- I choose to highlight the current day of the year using an IF-ELSE. --->
                                            <cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
                                                <td align = "center" bgcolor="##FFFF99">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendartoday">#ThisDay#</font>
                                                </td>
                                            <cfelse>
                                                <td align = "center">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendar">#ThisDay#</font>
                                                </td>
                                            </cfif>
                                        </cfoutput>
                                        <cfset ThisDay = ThisDay + 1>
                                        <cfelse>
                                            <td></td>
                                    </cfif>
                                </cfloop>
                                </tr>
                        </cfloop>
    the output from the cfdump is this: the first event date in the month of june.
    I need this to match the thisday part of the code in the cfloop function through the days of the week.
    Can anyone help me figure this part out?
    thank you, and really sorry about the 2nd post. I just woke up and hit the wrong button. again, really sorry all.
    CFmonger

    This is a small calendar. it will move to the next month at the end of this one, it can also go to the next month with a next / prev button that will let you go as far as you want. It is like all we have seen before. What I need to do it get the eventDate in my DB, that is set as date and put in as mm/dd/yyyy now, basically what I believe the query needs to do it to not only tell what month the calendar is on, but it needs to match any db records with any of the days in that month. Say we are in June: I have 3 records in June, on the 5th, 20th, and 26th. In all the 31 days in the month of June, just those 3 will show a link with an ID to the record that matches in the DB.
    I had it narrowed down with that query, but lose the variable once I try and cfif it. So I knew either my query is wrong, or my cfif is, probably both.
    does that help? can I make this work? am I even close?
    thank you.
    CFmonger
    By the way, here is the entire code with the next / prev nav for cycling through the months.
    <!--- Declaration of the variables --->
           <cfparam name = "month" default = "#DatePart('m', Now())#">
    <cfparam name = "year" default = "#DatePart('yyyy', Now())#">
    <cfparam name = "currentday" default = "#DatePart('d', Now())#">
    <cfparam name = "startmonth" default = "#DatePart('m', Now())#">
    <cfparam name = "startyear" default = "#DatePart('yyyy', Now())#">
    <!--- Set a requested (or current) month/year date and determine the number of days in the month. --->
    <cfset ThisMonthYear = CreateDate(year, month, '1')>
    <cfset Days = DaysInMonth(ThisMonthYear)>
    <!--- Set the values for the previous and next months for the back/next links.--->
    <cfset LastMonthYear = DateAdd('m', -1, ThisMonthYear)>
    <cfset LastMonth = DatePart('m', LastMonthYear)>
    <cfset LastYear = DatePart('yyyy', LastMonthYear)>
    <cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
    <cfset NextMonth = DatePart('m', NextMonthYear)>
    <cfset NextYear = DatePart('yyyy', NextMonthYear)>
    <cfset PreviousDay = DateAdd('d', -1, ThisMonthYear)>
    <cfset CurrentYear = DatePart('yyyy', Now())>
    <table border="0" width="100%" bgcolor ="#ffffff">
                <tr>
                    <td align = "center" valign="top">
                        <table border="0" width="100%" height="100%">
       <tr>
          <th align="center" colspan="7" bgcolor="#2b4e6e">
       <cfoutput>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="15%" align="left" valign="middle">
      <cfif (LastYear lt CurrentYear) OR (LastYear lte CurrentYear AND LastMonth lt startmonth)>
    <cfelse>
      <a href ="index.cfm?month=#LastMonth#&year=#LastYear#" class="calNav">Prev</a></cfif></td>
            <td width="72%" align="center" valign="middle"><FONT SIZE="3" face="Arial, Helvetica, sans-serif" color="##ffffff">#MonthAsString(month)# #year#</FONT></td>
            <td width="13%" align="right" valign="middle">
      <cfif (NextYear lt CurrentYear) OR (NextYear lte CurrentYear AND NextMonth lt startmonth)>
    <cfelse>
    <a href = "index.cfm?month=#NextMonth#&year=#NextYear#" class="calNav">Next</a>  </cfif></td>
          </tr>
        </table></cfoutput></th>
       </tr>
       <tr>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sun</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Mon</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Tue</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Wed</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Thu</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Fri</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sat</FONT></td>
       </tr>
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate Between #NextMonthYear# and #NextMonth# AND eventDate >= #dateFormat(Days, 'dd')#
    </cfquery>
                            <!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
                            <cfset ThisDay = 0>
                            <!--- Loop through until the number of days in the month is reached. --->
                            <cfloop condition = "ThisDay LTE Days">
                                <tr>
                                <!--- Loop though each day of the week. --->
                                <cfloop from = "1" to = "7" index = "LoopDay">
                                <!--- This turns each day into a hyperlink if it is a current or future date --->
             <cfoutput query="CaleventRec">
              <!---  <cfdump var="#eventDate#">
                                   <cfabort>--->
              <cfif #dateFormat(eventDate, 'dd')# IS ('Days, LoopDay')>
              <cfdump var="#eventDate#">
                                   <cfabort>
                                   <a href = "detail.cfm?id=#ID#">#Days#</a>
                                   </cfif>
              </cfoutput>
                                <!---
                                    If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
                                    If the values match, set ThisDay to 1.
                                    Otherwise, the value will remain 0 until the correct day of the week is found.
                                --->
                                    <cfif ThisDay IS 0>
                                        <cfif DayOfWeek(ThisMonthYear) IS LoopDay>
                                            <cfset ThisDay = 1>
                                        </cfif>
                                    </cfif>
                                <!---
                                    If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
                                    the day of the mnth and increment the value.
                                --->
                                        <cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
                                        <cfoutput>
                                        <!--- I choose to highlight the current day of the year using an IF-ELSE. --->
                                            <cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
                                                <td align = "center" bgcolor="##FFFF99">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendartoday">#ThisDay#</font>
                                                </td>
                                            <cfelse>
                                                <td align = "center">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendar">#ThisDay#</font>
                                                </td>
                                            </cfif>
                                        </cfoutput>
                                        <cfset ThisDay = ThisDay + 1>
                                        <cfelse>
                                            <td></td>
                                    </cfif>
                                </cfloop>
                                </tr>
                        </cfloop>
                        </table>
                    </td>
                </tr>
            </table>

  • Can I use a select and update statement in a single jsp file?

    I want to update the BUY table everytime I would add a SELL transaction.....I want to minus the stocks that I sold to those that Ive bought before.....
    note: I used a seperate table in BUY and SELL transaction
    After I Have added a transaction, I want to update the buy table. This is my problem, can I used both SELECT and UPDATE statement at the same time in a single jsp file for example like this:
    select * from test, test1;
    update test
    set total_shares=total_shares-Stotal;
    where stock_code=Scode AND name_broker=Sbroker;
    Can i have both of these statements in the same jsp file in oder to update the buy table?
    Or can anyone suggest how can process that update?THANKS!
    --------------------

    Can i have both of these statements in the same jsp file in oder to update the buy table?Yes. But wouldn't it have been easier just to try it?

  • Have Sony HDTV bought in 2003;the video in/out thingy doesn't fit the apple tv prong.  What can I buy and where to modify so I can plug in Apple HDMI cable?

    I have a 2002 Sony HDTV "ready" tv and am trying to hook up Apple TV2.  On the back of the tv, the connection point where the HDMI cable goes in does not match the Apple connection HDMI cable.  I'm guessing that I need some sort of connector that goes into the tv at one end and that will accept the Apple tv 30-pin HDMI cable  Is there such a thing?  What's it called and where can I buy it?  Thanks,

    Welcome to the Apple Community.
    The Apple TV specifications state clearly that a TV with HDMI connection is required. DVI is not necessarily going to work as a number of people have found out, although many others have been able to get it to work.
    A DVI cable may perform the same function as an HDMI cable for passing video signals but the hardware cards that it plugs into at each end may not.

  • Left outer join 3 tables with where-statement

    Hi folks,
    I hope you can understand (and maybe solve) my problem.
    Generally I try to left outer join three tables. The third table is used for a WHERE-statement.
    The three table structures are the following:
    table 1 (user)   
    user1 | key
    table 2 (detail)  
    key | ID
    table 3 (header)
    ID | user2                 
    ...and I want to achieve the following structure (as example filled with data):
    user | key | ID
    |-----|----
    xy    | a    | 001
    xy    | b    | #
    z     | b     | #
    The clue ist the usage of the third table. I need the table to set user1 and user2 equal (WHERE) but there are two problems:
    1) Obviously I can't left outer join two tables with each other. In this case I already used the 'key' of table 1 to join it with the 'key' of table 2. So I can't left outer join the 'ID' of table 2 with the 'ID' of table 3. Error message that I can only left outer join a table once. Any proposals?
    2) I have to include a WHERE to equal user1 with user2. But I am not allowed to use the user2 from table 3 because of the left outer join.
    I tried this coding:
    SELECT auser1 akey b~id INTO TABLE itab FROM ( table1 AS a
      LEFT OUTER JOIN table2 AS b ON akey = bkey )
      LEFT OUTER JOIN table3 AS c ON bID = cID )
      WHERE auser1 = cuser2.
    I would really appreciate your help.
    Regards
    MrclSpdl

    IF you want to join a DB table with an internal table, you need to use the 'FOR ALL ENTRIES' statement.
    select dbfields
    into table itab2
    from dbtab
    for all entries in itab
    where dbfield1 = itab-field1.
    This will get you a second internal table with all the corresponding data for the first selection.  You can then join them with a loop through the first table and a read table on the second table (for 1 - 1 relation) or a nested loop statement on both tables (for 1 - N relation).  Make itab a hashed table when using read table with key, use a sorted table if you need to loop without key access.
    Regards,
    Freek

  • N unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    some one can help me please
    i have no idea what i must to do.
    an unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    The Exception Handler gave all the info that you need. No need to print the whole stack trace.
    The exception handler says
    Exception Details: java.lang.IllegalArgumentException
    TABLE1.NAME
    Look in the session bean (assuming that is where your underlying rowset is). Look in the _init() method for statements similar to the following:
    personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
    personRowSet.setTableName("PERSON");
    What do you have?

  • Mutating table and row state - this was unexpected

    So, I learned in a class about 3 years ago to expect the following
    SQL> create table p (pk number primary key);
    Table created.
    SQL> create table c (fk number references p(pk));
    Table created.
    SQL> create or replace trigger t_insrt
      2  before insert on p
      3  for each row
      4  begin
      5   insert into c values (:new.pk);
      6  end;
      7  /
    Trigger created.
    SQL> insert into p values (1);
    insert into p values (1)
    ERROR at line 1:
    ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated - parent key
    not found
    ORA-06512: at "FORBESC.T_INSRT", line 2
    ORA-04088: error during execution of trigger 'FORBESC.T_INSRT'and so it led me to think that replicating ON MODIFY PARENT - MODIFY CHILD functionality wouldn't work in a BEFORE ROW trigger, but it does
    SQL> drop trigger t_insrt;
    Trigger dropped.
    SQL> create or replace trigger p_updt
      2  before update on p
      3  for each row
      4  begin
      5   update c
      6   set fk = :new.pk
      7   where fk = :old.pk;
      8  end;
      9  /
    Trigger created.
    SQL> insert into p values (1);
    1 row created.
    SQL> insert into c values (1);
    1 row created.
    SQL> select * from c;
            FK
             1
    SQL> update p
      2  set pk = 2
      3  where pk = 1;
    1 row updated.
    SQL> select * from c;
            FK
             2Why would the first scenario fail while the second succeeds? The update seems prone to a parent record also not existing, at least not by the BEFORE ROW trigger.
    ---=Chuck

    < mutating table and row state >
    BTW, you don't seem to have run into the mutating table error though 2 other threads today are also about it. You have a constraint violation, a different thing entirely.
    I believe the second scenario works because you're neatly avoiding the error of the first. The error "ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated" means that on insert Oracle is looking up the value you're trying to insert, not finding it, and raising an error. With the before trigger you are taking the assigned value from the insert, updating the parent to it, so that on actual insert when the check happens the value is there due to the update.
    I'm not convinced this is a good idea because any on-the-fly approach to data entry needs to be examined carefully.

  • WHERE Statement Help

    Hi,
    cant get to grips with this problem, need to select from
    dbo.booking_form
    all records that meet 2 statements. 1st allocated='completed'
    and 2nd
    account is not 'CASH' , ie all records that don't contain the
    word CASH in
    the field 'ACCOUNT' Below is the beginning just don't know
    the syntax for
    NOT, have tried several option but to no avail.
    Pricing.Source = "SELECT * FROM dbo.booking_form WHERE
    allocated =
    'COMPLETED' AND
    Thanks in advance.
    Simon

    Baxter wrote:
    > AND WHERE ACCOUNT NOT LIKE CASH
    You might also try WHERE ACCOUNT != 'CASH'; at least, I think
    that's
    another way to do it.
    > Dave
    > "Simon Gare" <[email protected]> wrote in message
    > news:e745k8$8dl$[email protected]..
    >> Hi,
    >>
    >> cant get to grips with this problem, need to select
    from dbo.booking_form
    >> all records that meet 2 statements. 1st
    allocated='completed' and 2nd
    >> account is not 'CASH' , ie all records that don't
    contain the word CASH in
    >> the field 'ACCOUNT' Below is the beginning just
    don't know the syntax for
    >> NOT, have tried several option but to no avail.
    >>
    >> Pricing.Source = "SELECT * FROM dbo.booking_form
    WHERE allocated =
    >> 'COMPLETED' AND
    >>
    >> Thanks in advance.
    >>
    >> Simon
    >>
    >>
    >
    >
    www.geobop.org - Family Websites
    www.invisible-republic.org - Adult political websites
    www.freedomware.us - The truth about Microsoft
    www.jail4bush.org - Tom Muck's favorite!

  • Update a filed value with powershell script with ordery by and where condition

    Hi
    I have below powershell script to update list columns but  how i update a field value with ordery by a column and where condition
    below is the part of my script
    $list = $web.Lists[$listName]
    $items = $list.items
    $internal_counter = 1
    #Go through all items
    foreach($item in $items)
    if($item["CourtNO"] -eq $null)
    #if($item["CourtNo"] -eq '1')
    $item["CaseNo"] = $internal_counter
    #how to add a column ordery by Title
    # and where Title field value from 1 to 10
    $internal_counter++
    adil

    Hi,
    You mean that you only need to update all items with Title field value in range 1..10 and order by them before run the loop statement update?
    If so, use CAML query to get the items only match the condition.
    #Build Query
    $spQuery = New-Object Microsoft.SharePoint.SPQuery
    $query = '<Where><And><Gte><FieldRef Name="Title" /><Value Type="Text">0</Value></Gte><Lte><FieldRef Name="Title" /><Value Type="Text">10</Value></Lte></And></Where><OrderBy><FieldRef
    Name="Title"/></OrderBy>'
    $spQuery.Query = $query
    $spQuery.RowLimit = $list.ItemCount
    $items = $list.GetItems($spQuery)
    Hope this help!
    /Hai
    Visit my blog: My Blog | Visit my forum:
    SharePoint Community for Vietnamese |
    Bamboo Solution Corporation

Maybe you are looking for