Problem quering a range of numbers

Hopefully someone can help. I have a query that I need to select results that are from the range -30 through any positive number up to 70.
My problem is my query is looking at (for example) -95 as a number greater than -30 which is shouldn't.  Does anyone know what I can use? Here is what I have:
<cfquery name="qcomp" datasource="mydb">
Select id, comp_id, daysremaining, startdate, company, howmanyteams, compname, teamname, SUM(totallost) AS totallost
FROM scoreboard WHERE daysremaining >= '-30'
group by compname, teamname, comp_id
order by compname, totallost ASC
</cfquery>  

What is the data type of the field in the database?
If it is a number type -95 is less then -30.
If it is a character/text type -95 is greater then -30.
And the quotes in your where clause says it is a character/text type:
WHERE daysremaining >= '-30'

Similar Messages

  • How do I select a range of numbers using IF function

    I am trying to select a name in a cell if the value of another cell is either a 5,6,7,8 or 9.  I have had success when I have just wanted numbers above 9 or below 5 by using formulas
    IF(Table 1::C3<5,T(Table 1::A3),T(Table 1::A2))
    And
    IF(Table 1::C3>9,T(Table 1::A3),T(Table 1::A2))
    But for the life of me can't get the range of numbers in between.
    I have tried including AND and OR functions in multiple ways but to no success.  I know I am overlooking some simple thing, I have tried scratching for nested if functions but no help there either, and the information file in numbers is horrendously useless.
    Please help.  I am using an ipad btw.

    This forum is generally for iPad and iOS problems. I doubt that you'll get an answer here.
    Furthermore, you don't say what app you are using. If Numbers, you should post here https://discussions.apple.com/community/app_store/iwork_for_ios
     Cheers, Tom

  • IF Else (javascript) with a range of numbers

    I am creating form fields in a PDF using Acrobat.  There is a field which you enter an amount (1-20, 21-100, 100+) and depending on what is entered the cost will be different.  So if 1 thru 20 units are entered the cost will be $199 per unit, 21 thru 100 units the cost is $175 per unit and 100+ units the cost is $150 per unit.  The line on the document looks like:  Number of Entities___ X Price per Entity___= Total___. 
    This is what I have so far to get the price;
    if (this.getField("No. of Entities").value == '1') {
    event.value = 199
    } else if (this.getField("No. of Entities").value == '21') {
    event.value = 175
    } else if (this.getField("No. of Entities").value == '101') {
    event.value = 150
    } else {
    event.value = 0 // Default value here
    I have it working for a single number, I just can't get a range of numbers.
    Any help would be great, thanks.

    The problem is in the logic of your condition.  This will only hit when you have the value of 1, 21, or 101.
    I'd suggest a different set of logic, based on <= operators
    if (this.getField("No. of Entities").value <= '20') {
    event.value = 199
    } else if (this.getField("No. of Entities").value <= '100') {
    event.value = 175
    } else if (this.getField("No. of Entities").value >= '101') {
    event.value = 150
    } else {
    event.value = 0 // Default value here
    or something along those lines.  I would also imagine that having the operators be numeric (no quotes on the constant) would be more effective.
    But this is general JS advice and not tried within a form.
    Also, I have a question for you.  Are you designing this as an PDF form inside Acrobat, or are you using LiveCycle Designer?  That information will help when we move this issue into the proper forum.

  • Using the IF function with a range of numbers

    I am working with the IF function and trying to get it to work "if" the number I'm examining is within a range of numbers.
    Example:
    If a wigit costs between $1000 and $1999, then a discount of $100 is given
    If a wigit costs between $2000 and $2999, then a discount of $150 is given
    If a wigit costs between $3000 and $3999, then a discount of $225 is given
    And so on.
    If cell A1 always holds the current cost of the wigit being sold.
    cell B1,B2,B3 holds the value of the discount values respectively.
    In cell C1 I would like to return what the current discount value is to be given for the wigit price in cell A1?
    How do I do this using the IF function or is there another way?
    Thanks,
    Ryan

    HI Ryan,
    In this post you have, except for the issue noted by Badunit, the basis for the discount table described by Wayne:
    I'm trying to devise a way of knowing what Cash Card a customer will receive depending on the amount of the purchase, based on the following table:
    $0         to $999 purchase         =      $50 Cash Card
    $1,000 to $1,999 purchase     =     $100 Cash Card
    $2,000 to $2,999 purchase      =     $200 Cash Card
    $3,000 to $3,999 purchase      =      $300 Cash Card
    $4,000 to $4,999 purchase      =      $400 Cash Card
    $5,000 to $5,999 purchase      =     $550 Cash Card
    $6,000 to $6,999 purchase     =      $700 Cash Card
    $7,000 to $7,999 purchase      =     $850 Cash Card
    $8,000 to $8,999 purchase     =      $1,000 Cash Card
    $9,000 to $9,999 purchase     =     $1,200 Cash Card
    $10,000 to   UP   purchase     =     $1,500 Cash Card 
    To take care of the issue noted by Badunit, you need to revise the top line to state the minimum purchase necessary to earn a cash card, then add a line above that to handle purchases under that amount. I've arbitrarily chosen a $500 minimum, which results in these two lines:
    $0             to $499 purchase        =      $0 Cash Card
    $500         to $999 purchase         =      $50 Cash Card
    To write this as Wayne's table, you need to remove all of the text (including the $ currency markers), the top end of each range, and the = sign. What you're left with is two columns of numbers: The bottom number of each range of values, and the number telling the dollar amount of the cash card for that range. Here's your table, edited to make it work with LOOKUP:
    Here is a second table (Main), containing only the labels and the two cells involved in the calculation of the cash card amount. The Purchase amount is the amount used in your example. The Cash Card amount is produced by the LOOKUP formula below the image.
    Purchase price is in cell B1 of the table "Main". The LOOKUP formula is in B2:
    B2: =LOOKUP(B1,CC Amt :: A,CC Amt :: B)
    LOOKUP acts essentially as you request in your post containing the iPad image with the time shown as 1:46. But it takes a much simpler approach.
    Here's the syntax:
    LOOKUP(search-for,search-where,return-from)
    LOOKUP gets the search-for value (2535) from cell B1.
    It looks in column A of the table "CC Amt" for the largest value less than or equal to the search-for value, and finds 2000.
    It returns the value from the same line of column B (200).
    Below are two more examples. Main-2 and Main-3 are copies of the Main table. Both contain exactly the same formula as Main, but have had a different Purchase price amount entered. LOOKUP uses the same CC Amt table as is used above, and returns the appropriate Cash Card value for each of the two new amounts:
    You may, as implied in your 1:46 post, use a pair of cells to calculate the Cash Card amount for each widget in the purchase, then total the Cash Card amounts, or you may use a single pair of cells, one containing the total purchase amount, the other containing the Cash Card amount due for that total. That choice is yours. The formula is the same for either case.
    Regards,
    Barry

  • TS1398 problem in wifi range i use my phone my rume but i think china mobile is working better than iphone ......

    problem in wifi range i use my phone my rume but i think china mobile is working better than iphone ......

    I don't understand what you are asking here. Can you try and ask again?

  • Find a range of numbers in one cell and output in another

    Here I am again with something I just can't seem to find an answer to:
    I need to find the range of numbers in one cell and place that value in another, like so:
    Cell A1 says: "3 - 8"
    Cell A2 returns: 5
    Any simple formula to do this?

    Hi gunkie83,
    Yvan's formula does perform properly. He stated: Here the decimal separator is comma so Numbers use the semi-colon as parameters separator but the formula is OK. CAUTION, here I left the semi-colons.
    Yvan is in France using the French version of iWork. For the U.S.A. semicolons need to be changed to a comas as I have in the following formulae.
    =VALUE(LEFT(A,SEARCH("-",A)-1))-VALUE(RIGHT(A,LEN(A)-SEARCH("-",A)))
    this returns -5
    =ABS(VALUE(LEFT(A,SEARCH("-",A)-1))-VALUE(RIGHT(A,LEN(A)-SEARCH("-",A))))
    this returns 5
    One important observation in cell A2 the text reads as 3 - 8 not 3-8. Also it can be inputted as 3 -8 but not 3- 8. Watch those spaces. Fun huh.
    Hope this helps. Again Yvan thank you.
    Cordially,
    RicD

  • Printing a range of numbers

    Dear All,
    I have to print a range of numbers that I give in selection screen, say 1 to 20 in two columns (on a sticker).
    Kindly give me the logic, how to go about it.
    Regards,
    Alok.

    Hi Alok
        you can do like this
    TABLES : caufvd.
    SELECT-OPTIONS  :  s_auart FOR caufvd-auart. 
    write : "from",s_auart-low , "to", s_auart-high.
    Regards
    Wiboon

  • Averaging a range of numbers

    I'm looking to try and average a range of numbers, but instead of doing it by certain rows (that is, average rows A1 through A30), I'd like for Numbers to average cells if they fall into a certain numerical range (that is, average cells whose values are 1-30, but whose rows might be A1 through A70 or A1 through A42--you don't know). Since my cells are numerically ordered, I could go through and find myself the cells that fall into the range (is it A70 or A42?), but I have a few thousand rows so that's really not economical in terms of time. Could someone help me to figure out the function to average cells based on their numerical value?
    Thanks!

    Here's how you might set up the formula:
    The formula in B3:
           =AVERAGEIFS(Table 1::A,Table 1::A,">"&B1,Table 1::A,"<"&B2)
    It's a little tricky because you need the " " in the proper places.  You could hardcode the values into the formula itself with something like ">0" and "<31" but it's generally good practice to put the conditions in cells so you can vary them as needed.
    SG

  • How do you create the equivalent of a named  range in Numbers for iPad?

    At first I didn't think Numbers could handle named ranges but when I look at the formula written for the "Personal Budget Template"  The "Actuals" column is calculating using named ranges but I am not sure how the ranges were created...  In any case it does appear that there is a way.  Does anyone know how?

    Those technically are not named ranges. Its using the information in the "header" rows. Once you make a row a header row and sum it (or include the whole colun in some function). It will use the data/name in the header row in the equation to make it clearer. I do not think you can make named ranges in Numbers.
    I made a test excel workbook using two formulas to sum a range, one with named ranges one without and sent to my ipad, when i opened it up...and downloading... yep...  it converted the named range to a regular range with letters and numbers. no named ranges support.
    But learn to use your header and footer rows to get the same affect in many functions.
    When i assign both header rows and columns to a table, it combines them into one string to show "Jan 2001" when I had a header column with Jan in A2, and a header row with "2001" in B1, then used the value in an equation.
    The one your looking at I think says something like "=Sum(actuals)". that formula is in a designated footer row, and has a designated header row. at the top of that column is the label "actual". if you look at the difference column formulas, you will see how it combined header rows and columns into a single text string and use it to cross reference the cell being used.
    Jason

  • Problem in Number range tranfer-OBH2

    Dear Gurus,
    I have  a problem in number Range of OBH2- tanfer
    i given company code and number range and specified the fiscal year and target year.
    But system showing  List contains no data.
    Help me where i can check, anything i missed.
    Regards
    sreenivas.P

    Hai Sree,
    While copying the no ranges from target company code first u can check the whether no ranges are there or not then copy the no ranges
    Regards
    Madhu I

  • Hunt Pilot - range of numbers

                      HI,
    I have a simple question.
    I'm using call manager version 8.6. I have configured hunt pilot as range of numbers instead of specific number.
    eg: 898949X
    it wil work properly right. I want to confirm.
    I tested it is working fine.

    Yes, it is allowed to use special characters in Hunt Pilots and documented:-
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/7_1_2/ccmsys/accm-712-cm/a03rp.html#wp1043520
    - Basant

  • Formula or solution to get the range between numbers in on column (KF)

    Hello All,
    I am in need of a solution (formula) to get the range of numbers in one column of query results.
    I have a variable number of sales orders and three keyfigures that show the number of days between when the order was received and when the customer received the order.
    I need to get the range of days from each keyfigure column
    ex.
    Sales Order          Days-Order to Box   Days-Order to Release   Days-Release to Box
    SO 11111                       10                                   2                                 8
    SO 11111                       13                                   5                                 8
    SO 11111                       12                                   2                                10
    SO 11111                       16                                   4                                12
    The range for the  Days-Order to Box   Days-Order to Release   Days-Release to Box
                                             6                                     3                                 4
    I have tried using formulas for Min and Max setting the Calculations tab for both Results and Singles Values
    than creating a formula using SUMCT, SUMRT and SUMGT but I get the red X for results.  I have used NOERR(x) and NODIV(x)
    to determine that the formula is seen as having undefined calculations or errors in the logic (I do not get errors when saving the query).
    NOERR(SUMRT (OtB-Max - OtB-Min))
    OtB-Max is a formula that hides the singles values and displays the results as the Maximum number in the column Days-Order to Box
    OtB-Min is the same kind of formula but it displays the Minimum number for the same column.
    Thanks in advance for any suggestions.
    Btw - I have searched this forum and the How-To forum for BI on the SAP site without finding an answer -
    If I have missed one in my search I apologize and would appreciate a link to it

    Hi.
    As I think only use of virtual KF and APA code will help you.
    Regards.

  • TS1702 I am having a problem with the apple app Numbers.  It has been waiting for a week.  I can not open it or delete it

    I am having a problem with the apple app Numbers.  It has been waiting for a week.  I can not open it or delete it

    I found the images here: https://support.mozilla.org/en-US/questions/977542#answer-501598

  • Borre sin querer un archivo de numbers de la nube lo puedo recuperar ?

    borre sin querer un archivo de numbers de la nube puedo recuperarlo ?

    If you go to icloud.com >> sign in >> iwork >> numbers, it's gone?
    You could check ~/Library/Mobile Documents.
    Or, restore from a back, such as time machine.

  • Selecting againt individual number and a range of numbers

    I have a users who inputs 1400 individual material numbers in the selection screen of a query and then 2 ranges of material numbers. The query bombs out with the following error, "<internal error> Receiving from the BW server failed BW server raised exception:System_Failure Do you want to see more information?"
    My first thought is who in their right mind would insert 1400 individual material numbers.  But the report runs fine with the 1400 individual numbers.  It when you add a range to the selection with the individual numbers that a problem occurs. 
    Has anyone had this problem?  Or does anyone have any advise on how to correct this problem?

    I've narrowed it down even further.  I can insert 100 materials with to selections.  Everything is ok.  I run it with 200 materials and the same 2 selections.  NOT OK.  Then I tried with only 1 of the selection ranges NOT OK.  If I run just the 200 Material it's OK.  I went to st22 and got the error:
    An exception that could not be caught occurred.
    What happened?
    The exception 'CX_RSR_X_MESSAGE' was raised but was not caught at any stage in
    the
    call hierarchy.
    Since exceptions represent error situations, and since the system could
    not react adequately to this error, the current program, 'SAPLRRMS ', had to
    be terminated.
    Any Ideas?

Maybe you are looking for

  • DV9429 us laptop: Has anyone successful​ly added more than the stated 2 gigs maximum RAM?

    Hi, this computer works fine with Ubuntu (10.10, Unity makes it a dog ), unusably slow with Vista, and who knows about Win7. If you have successfully added more RAM than the 2gigs which supposedly is the max, let me know how it went. 4 gigs would mak

  • Why Does Premiere CS6 Output 29.97fps when Encoding to 23.976 fps?

    My project is XDCam EX, 23.976 fps. I exported to DVD MPEG and both VLC and Windows Explorer details report 29.97fps file format. I downloaded the latest updates two days ago. Just wondering why the encoder refuses to leave 23.976fps footage and proj

  • Variant Config with Sub-contracting/Vendor

    Hi Experts, I've a scenario where we take the Sales Orders for configurable items, using the configurator. Depending on certain configuration parameters (i.e input items/operations), we have a need to send the Sales Order directly to our Vendor/Sub-c

  • Lenovo t530 charger broken please help me

    Ok so I'm currently studying abroad and the other day the power cord ripped by the plug and now the wires are exposed. Wrapping it in electrical tape did nothing and now I'm stuck here without a computer to do work on as every time I plug it into an

  • FPGA CRIO LabView - Why No Signal or Low signal?

    I'm programming LabView 8.2/RealTime 8.2 on a CRIO-9002 equipt with a 9102 chassis. I have a some 4-20mA modules, +-10v modules and last but MOST IMPORTANTLY a 9233 +-5v module. I've programmed the FPGA and realtime and have been able to acquire and