Finding numbers in recordset.

Easy one for the experienced guys:
I have a record with a list of comma separated values, IE,
1,2,4,6,12,24
or simply
24
I need to write a query where I find all records where the
specific number/value I'm looking for is in the list. For example
I’m looking for all records that contains the number "2".
I've used the like operator
select * from my_table where my_column like
'%#form.my_search#%'
(and a few variants), but the problem is, it finds the record
with just "24" in it as well, whereas I want records that contains
"2". And not anything that has a 2 in front or behind it.
All numbers are integers, as they refer to a row identifier
on another table.
How to do this?
Thanks

Though I agree with comments here about normalizing
databases, if you are stuck with this, here is a solution. A query
of a query. Converts your 1,2,3,4,5,6 to '1','2','3','4','5','6'
which can then be used with the SQL operator IN.
<!--- Make sure your search parameter is surrounded by
single quotes, then surrounded by double quotes --->
<cfset Form.search = "'2'">
<cfquery name="q1" datasource="yourDatasource">
select * , '''' + REPLACE(csv_data,',',''',''') + '''' as
mod_data,
'#Form.search#' as search_parm
from test
</cfquery>
<cfquery dbtype="query" name="q2">
select * from q1
where search_parm IN (mod_data)
</cfquery>
<cfoutput query="q2">
#anyColumnYouSelectedInQuery1or2#<br>
</cfoutput>

Similar Messages

  • Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers and firefox

    Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers, firefox, and when trying to move any file from the downloads folder.
    This is a serious pain.
    Please help.
    WB

    Yes, all I can tell you is that Finder does not have that function in ML. Your system is "working as expected".
    You can file feedback here.

  • Spotlight doesn't find "numbers," in Numbers.  Way to fix that?

    Hi.
    With Excel documents, Spotlight finds numbers within the document. i.e. an invoice number, an amount, etc.
    However, Spotlight is not finding any numbers inside my Numbers documents.
    Is there anyway to change or fix this? THanks for the help. Even if there is a third party way or something? Thanks!

    i can imagine why spotlight does no indexing on data inside cells... it looks to me pretty useless to index files that have hundreds of reoccurring numbers numbers and numbers - would you like to have an overview of all files that has the number 6 in it, or 51.... and than to think of it that a lot of numbers in a table are not numbers at all, but only calculations
    however, there is a way to get spotlight informed:
    use the inspector, document (most left tab) there is a option to set various spotlight hints like author, title, keywords and comments
    hope that will help
    wished that Numbers and others were more scriptable, so i could get some cell contents and paste it into the keyword field there

  • Spotlight in "Open Dialog" fail to find "Numbers" file

    Hi,
    when i use the spotlight search tool inside the open dialog box from Numbers it seem to be unable to find "Numbers file".
    Let say I have 4 files on my Hard Drive :
    - FileName1.xls
    - FileName1.Numbers
    - FileName2.xls
    - FileName2.Numbers
    If I type "FileName" in Finder > Spotlight It get all the 4 files.
    If I type "FileName" in Numbers > Open Dialog > Spotlight it get :
    - FileName1.xls
    - FileName2.xls
    Either I check or not different search options (filename / content / Start / My iMac ...)
    Any idea what's wrong ?
    Thank you.

    Bonjour,
    Concernant votre dernier message :
    oui, j'ai vu votre capture. C'est du Page, pas du Numbers :-) une différence serait possible, mais lire la suite ci-dessous...
    La corruption d'index est une piste. Mais comme Spotlight trouve mes fichiers dans d'autres conditions, cela indiquerait un Index correct. Toutefois, ce point est très technique et je ne ferrais aucun pari sur la "mécanique" d'Index Spotlight. J'ai donc utilisé l'outils recommandé dans la discussion donnée en lien (je n'aime pas trop l'idée qu'un outil tiers bidouille les entrailles de l'OS d'Apple, mais bon). Apparemment l`'outils détruit l'index et Spotlight se met au travail et ré-index le disque.
    Mais cela n'a rien changé.
    j'aimerais approfondire un peu si vous le coulez bien. Avec 37 805 points vous devez avoir quelques ressources en réserves ;-)
    Appelons ça le "bogue" ; même s'il peut s'agir d'un problème de paramètre quelconque modifié maladroitement dans mes préférences systèmes ... En explorant différentes pistes et en vous les soumettant je peux peut être vous mettre sur la voix d'une solution qui ne vous vient pas immédiatement à l'esprit car très spécifique à mon cas particulier.
    Nous sommes d'accord sur ce point : la recherche dans Numbers > Ouvrir est une implémentation de Spotlight. Manifestement cette implémentation est pleines d'options et présente des différences significatives avec le Bureau.
    Exemple 1 :
    Dans Finder la recherche par type > autre est un champ vide.
    Dans Numbers la recherche par type > autre est une liste de choix.
    Il semble que Spotlight dans Numbers ne prennent en considération que les fichiers que Numbers peut ouvrir. Et pour cela il se base sur l'extension. Et le bogue fait penser que les développeurs auraient oublié l'extension ".numbers" !
    ------------ EDIT
    J'ai effacé tout une série de tests tant la découverte finale est la plus importante ...
    En modifiant l'extension d'une application en .numbers elle est apparue dans ma fenêtre Numbers !
    J'en conclu que "mon" Numbers n'affiche via spotlight QUE les fichiers portant une extension compatible (xls, cwk, txt) ET que le fichier est de type "binaire / app / ???".
    L'erreur serait sur ce dernier aspect : les fichiers numbers ne sont PAS des fichiers "binaire / app".
    Ou orienter les recherches, puisque, manifestement, ça marche sur votre Mac ?
    Merci d'avoir étudier cette longue réponse.
    --Edit
    Numbers trouve les .php (des fichiers text assimilable à des executables) mais ils sont grisés donc impossible de les ouvrir.
    Là je dis, ça devient du n'importe quoi .... :-(

  • GREP to Find Numbers at End of Story

    I want use GREP to do a find to locate any six digit number or just the numeral zero at the end of each story in my InDesign 4 documents.
    So far, I have ben able io identify six digit numbers by searching for the following \d{6} But when I add the end of story location marker,  \z\d{6}, no results are returned.
    What do I need to do to:
    1. get the expression to search for the number at the end of the story
    2. amend my expression so that it finds either a six digit number or the numeral zero
    Any help on this would be appreciated

    kmc27 wrote:
    In the InDesign document here isn't the six digit number in the first example and the zero in the second example at the end of the story? Wouldn't \z find these numbers?
    No, to both questions.
    \Z is a location marker, and it only matches the position "end of story". You have a hard return between the digits and the location 'end of story'.
    This will work in your example document:
    (\d{6}|0)\r\Z
    and it would be wise, in your case, to mark the hard returns as 'optional':
    (\d{6}|0)\r*\Z

  • Where to find Numbers 2.3

    I want to have the older version of numbers to work with, because it has several features that I use regularly that are lacking in Numbers 3.0. Where can I find the older version? I purchased it back in December 2011.
    Clyde Stauffer

    Hi Jason,
    And here are two documents open at the same time, Numbers 3.0.1 on top, Numbers 2.3 below:
    Come on in, the water's fine!
    Regards,
    Ian.

  • I can't find numbers on my hard drive

    I had been working a spreadsheet in numbers.  Not sure what happened but now all I can access is a PDF of the spreadsheet.  When Iopen applications and select iWork, Numbers is not there just the PDF.  I can't find my original installation CD that came with my MacBook Pro.  Is Numbers possibly still on my hard drive and I just cant find it?  Please help me get it back!  Thanks

    iWork isn't on the OS installation DVD - it's a seperate purchase, either on DVD (iWork '09) or as individual applications from the App Store.
    Assuming it was installed from a DVD, you'll need to find it.

  • Is there different software installed on new iMac from Bestbuy vs Apple store? I purchased new 27 iMac and cannot find NUMBERS, PAGES or KEYNOTE

    Purchased new 27 iMac and cannot seem to find PAGES, NUMBERS or KEYNOTE programs. I installed OS X MAV and still cannot find them. In the app store they cost money.

    They need to be downloaded; you can use this in case they do not show up on your Purchases list:
    http://www.apple.com/creativity-apps/mac/up-to-date/

  • Query to find numbers with dashes

    Help. I want to write a query that will return all the numbers in my table that have dashes (-) in positions 5, 8 and 12. I tried using the INSTR function, with the positions, but do not get the desired result.
    All suggestions are welcome!

    SQL> create table y as select '1234-67-901-34' y from dual;
    Table created.
    SQL> select to_number(x) from (select replace(y,'-') x from y where substr(y,5,1)='-' and substr(y,8,1)='-' and substr(y,12,1)='-')
    TO_NUMBER(X)
    12346790134

  • Where do I find Numbers 3.2 basic user manual?

    As a newbi to Numbers 3.2 (1861) I want a simple manual and/or video tutorial for basic operation of Mac Numbers 3.2 program and spreadsheet data input instructions.

    Take a look at Tutor for Numbers on the Mac App Store. I've never used the app, but reviews seem good.
    Jerry

  • I installed OSX Mavericks but cannot find Numbers or Pages is this not part Mavericks

    I have installed OSX Mavericks 10.9.4 and notice there is no Numbers,Pages or Presentation Software. Are they not a part of Mavericks? I also notices that Safari has disappeared of the Dock I assume the new safari should be on the dock as well?

    No, it's not part of Mavericks, or any OS. Check the App Store.
    Check the Applications folder. If Safari is there, drag it into the Dock. If it isn't, try installing the 10.9.4 combo update.

  • Hello, where I can find numbers about the eCPM & fill rate ?

    I'm a french 18 years old, and in order to release my app, I need to get more "official" information about the eCPM & fill rate (like the average fill rate) with iAd or whatever.
    Thank you for your help !
    J.N

    RSRPARAMETRIZA for Bex Analyzer 7.0
    RSRVARIANTDIR     for Bex Analyzer 3.x
    RSRVARIANTDIR     Directory of Variants for Queries and Selection Objects               
    RSRVARIANT             Variant Values BEX               
    We can access to value of one variant with name of query COMPUID (from RSRT --> Technical Informatione -->Data from Query Definition  --> Techn. Definition Name) or with the name of Variant from RSRVARIANTDIR (the same for the technican nema of query COMPUID)
    Edited by: Pierfrancesco Marvulli on Aug 31, 2011 3:23 PM

  • Numbers freezes when I attempt to open a file from the iCloud

    Hello,
    My Numbers app for my iMac freezes when I attempt to open a spreadsheet file from the iCloud.  These same files open fine on my iPad, and I make sure to close Numbers on my iPad before I attempt to open the file on my iMac, but it makes no difference.  The app freezes, and I have to manually force stop the Numbers process.  Any help would be appreciated.

    How do I get the dock to recognize the latest numbers version I have.
    Go to the Applications folder, find Numbers 3 and drag it to the dock. It will then look like the lower icon here (the one with the 4 columns). 
    Another way is, if Numbers 3 is already open, to right-click the icon in the Dock and choose 'Keep in Dock' under 'Options':
    You can drag the icon with the three columns off the Dock if you don't want to open Numbers 2 from the Dock.
    SG

  • HOW DO I GET NUMBERS TO DO WHAT I WANT?

    HELP PLEASE:
    I  FIND NUMBERS  CONFUSING.  THE OLD WORKS SPREADSHEETS WERE SO MUCH EASIER/SIMPLER.
    I CAN’T SEEM TO GET THE FORMULAS & FUNCTIONS ENTERED CORRECTLY.
    I DON’T KNOW WHAT THEY MEAN “PRESERVE ROW” OR “PRESERVE COLUMN”.. SO DON’T KNOW IF I NEED TO CHECK
    ONE OF THEM OR NOT…AMONG OTHER THINGS.
    I’M TRYING TO MAKE A SPREADSHEET FOR TWO INVESTMENT ACCTS.
    ONE HAS A LARGE NUMBER OF STOCKS IN IT.
    THE SECOND HAS ONLY A FEW STOCKS BUT THEY ARE THE SAME STOCKS WHICH ARE IN THE FIRST ACCT. AS WELL.
    THAT MEANS MOST OF THE CELLS IN COLUMNS F & G (BELOW) WILL BE EMPTY.
    FOR THE PURPOSE OF MY EXAMPLE:
    “A ACCT“  WILL SHOW ONLY 4 STOCKS  & “B ACCT” WILL HAVE ONLY 2 STOCKS. I THINK THAT’S ENOUGH FOR YOU
    TO SEE WHAT I’M ATTEMPTING TO DO.
    LETS SAY THE COLUMN HEADINGS ARE:
      A                 B                          C                D                  E                             F                 G                           H
    SYM       DESCRIPTION       A ACCT#SH     CLOSE    A ACCT TTL VALUE     B ACCT#SH   B ACCT TTL VALUE   ACCTS A&B TTL
    I WANT TO MULTIPLY ACROSS EACH ROW      THE # SH    TIMES    THE CLOSE  — TWICE
    COL C  TIMES D SHOULD EQUAL E
    COL F  TIMES D SHOULD EQUAL  G
    THEN I’D LIKE TO ADD E + G AND HAVE THEIR TOTALS ENTERED IN COL H IN EACH ROW.
    ONCE ALL THAT’S DONE,  I’D LIKE COL. E TOTALED, COLUMN G TOTALED AND COL H TOTALED.
    FOR EXAMPLE:
         A             B                         C                 D                  E                          F                        G                         H
    1. SYM    DESCRIPTION       A ACCT#SH     CLOSE    A ACCT TTL VALUE     B ACCT#SH   B ACCT TTL VALUE    ACCTS A&B TTL
    2. XYZ     XYZ STOCK               200             25.00           $5,000.00              150                  $3,750.00           $8,750.00
    3. STU     STU STOCK               100             10.00           $1,000.00            
    4. PQR     PQR STOCK               500             20.00         $10,000.00             100                   $2,000.00         $12,000.00
    5. MNO    MNO STOCK              100             12.75           $1,275.00            
                                                                                    =SUM (E2:E5)                               =SUM (G2:G5)      =SUM (H2:H5)              
    I THINK I KNOW HOW TO WRITE THE FORMULAS TO TOTAL THE COLUMNS. I CHOOSE  “EDIT FORMULA” UNDER  “FUNCTION” AT
    THE TOP OF THE SPREADSHEET AND WRITE AS I’VE SHOWN ABOVE IN AN EMPTY CELL AT THE BOTTOM OF EACH COLUMN.
    IS THIS  CORRECT?
    WHAT I HAVEN’T FIGURED OUT IS HOW TO GET THE MULTIPLICATION DONE ACROSS THE ROWS OR THE ADDITION FOR COL. H
    I THINK I KNOW WHAT THE FORMULAS SHOULD BE  BUT DON’T KNOW HOW TO GET THEM ENTERED OR WHERE….
    I’M DOING SOMETHING WRONG BECAUSE  I GET ONLY ONE  NUMBER AT THE BOTTOM OF COLUMN E  INSTEAD OF MULTIPLYING
    ACROSS,  THEN TOTALING THE COLUMNS
    I THINK THOSE FORMULAS SHOULD BE:
    COL E  SHOULD BE:   =PRODUCT(C,D)         AND   COLUMN G  SHOULD BE: =PRODUCT(D,F )        AND COL H SHOULD BE: =SUM(E,G)
    CORRECT?  IF NOT PLEASE ADVISE WHAT THEY SHOULD BE.
    IF MY FORMULAS ARE CORRECT, HOW DO I GET NUMBERS TO DO IT?  PLEASE PRETEND YOU’RE SPEAKING TO A 5 YR OLD…..
    I’D SAY 1O YR OLD BUT THEY MAY BE MORE FAMILIAR WITH THE VOCABULARY AND HOW TO DO THIS THAN I AM.
    THANK YOU.

    It's incredibly hard to read a post when it's in ALL CAPS.
    But the answer to your question is copy and paste. When you have a cell that contains a formula, and you copy and paste it into another cell, firstly, the formula gets pasted, not the value, and second, the formula uses relative cell values. What that means is, if your formula in E2 is C2 * D2, and you copy and paste that cell value into E3, it will by default become C3 * D3. (You CAN change a formula to use absolute cell values if it suits your spreadsheet - when you edit the formula, the drop down for each cell number includes a value like $C2 which will not change when you paste it into a lower row.)
    by the way, it's usually faster just to use the equals sign when you enter a formula in a cell. eg, click into E2, press equals to start the formula, click into C2 to make that the first cell in the formula, type "*", then click into D2 and click the green tick to confirm the formula.
    Matt

  • Can you use Find/Change to search for many different words at once?

    I have an 80 page catalogue in Indesign (CS5) - it has several thousands of catalogue numbers listed as text within it. I've just been given a list of 1000 catalogue numbers to search for and if they appear, remove them - is there any way to search for them all in one go, rather than one by one?
    I've started using Find/Change to search for the catalogue numbers but seem to only be able to search one catalogue number at a time that way.
    Any ideas welcome!
    Thanks

    GREP can search for more than one phrase "at once" (i.e., in one operation), like this:
    word1|word2|word3
    -- the pipe | delimits the separate words. Then again, GREP Is Not Magic™. This --
    ...  a list of 1000 catalogue numbers to search for ...
    is a bit too much to copy-and-paste into the single Find What line. There is a limit of ten or twelve (or something) OR phrases you can use in GREP.
    On the other hand: GREP is great at finding numbers. If all of your catalogue numbers obey some basic rule, for instance "all of them consist of 6 digits and there are no other numbers with exactly 6 digits", well, that we can probably work with.

Maybe you are looking for

  • How can i transfer my music from ipod classic to itunes on imac

    have an ipod classic, just switched from pc to imac.  would like to load my music from my ipod to my imac.  how can i do this?

  • Error while creating SQL Subscription control in Web Analysis...

    Hi, I created a report using SQL Spreadsheet object. I want to associated a filter for this result set so that the user can use a drop down box to select the desired date. When I drag and drop the SQL Subscription control it prompts me to select a da

  • Cancelling automatic login to an e-mail address

    I want to use Firefox to log into one e-mail address and MS Outlook 2000 to log into a second e-mail address. Now Firefox automatically logs me into one e-mail account with Verizon and the Verizon page doesn't show anyplace to log into another e-mail

  • How to convert varchar to date datatype while insert or update in table

    Hai All I need to convert to varchar to date. I have two Tables T1,T2 T1 Structure Code varchar Time varchar Date varchar T2 Structure Empname var Empcode var Intime date Outtime date Intrin date Introut date Att_date Now i need to move Time form T1

  • PDF modified while opened in preview

    Here is a weird behavior (bug) for 10.6. When a pdf file is modified outside while it is opened in Preview, now Preview automatically shows the first page. (The behavior for Leopard was showing the updated pdf in the current page.) This new behavior