Query Data With....

I hv this table

Cust     ID
A         123-45
B         123344
C         1-2-45
D         1 2227

Q,

How to find cust ID with - only or those with spaces

Thanks
0
Utf
11/5/2007 4:23:01 AM
access 16762 articles. 3 followers. Follow

3 Replies
1165 Views

Similar Articles

[PageSpeed] 0

"zyus" <zyus@discussions.microsoft.com> д���ʼ�
news:387CB40E-B52D-4FCD-AC66-F5014EBBA57E@microsoft.com...
> I hv this table
>
> Cust     ID
> A         123-45
> B         123344
> C         1-2-45
> D         1 2227
>
> Q,
>
> How to find cust ID with - only or those with spaces
>
> Thanks


select * from tablename where id like '%-%'


0
wangaiguo
11/5/2007 5:26:30 AM
Tried...but failed..

"wangaiguo" wrote:

> 
> "zyus" <zyus@discussions.microsoft.com> дÈëÓʼþ
> news:387CB40E-B52D-4FCD-AC66-F5014EBBA57E@microsoft.com...
> > I hv this table
> >
> > Cust     ID
> > A         123-45
> > B         123344
> > C         1-2-45
> > D         1 2227
> >
> > Q,
> >
> > How to find cust ID with - only or those with spaces
> >
> > Thanks
> 
> 
> select * from tablename where id like '%-%'
> 
> 
> 
0
Utf
11/5/2007 6:36:00 AM
"zyus" <zyus@discussions.microsoft.com> wrote in message 
news:1B09517D-2472-46AE-B1A3-64C078C419E6@microsoft.com...
> Tried...but failed..


>> select * from tablename where id like '%-%'
>>


Try:

select * from tablename where id like "*-*"

Depending on your ms-access settings, % is not always considered a wild 
card....


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com 


0
Albert
11/5/2007 7:12:44 AM
Reply:

Similar Artilces:

Filtering Data
I have a spreadsheet that contains a column for Investigator Name, Pt. ID and Date of Enrollment as follows. I need to filter how many patients were enrolled by each site per month. Should I use an advanced filter, I'm not sure how to do this. Any help would be greatly appreciated. Investigator Pt. ID Date Dr. Black 01-001 08/09/03 01-002 08/09/03 01-003 08/12/03 01-004 08/13/03 Dr. Smith 03-001 08/16/02 03-002 08/16/02 03-003 09/06/02 03-004 09/06/02 03-005 09/06/02 03-006 09/20/02 Regards, Dee ...

Timer for Queries?
Does anyone know of a macro or add-on that I could use as a simple timer for queries? I don't like to use the CPU time in the Task Manager because of it's inaccuracy when not receiving full CPU usage. THanks for any suggestions -- cmungs Exactly what are you trying to accomplish? Are you trying to cause a query to run automatically every so often? If so, you will need to use the timer event on a form to do that. -- Lynn Trapp Microsoft MVP (Access) www.ltcomputerdesigns.com "cmungs" <cmungs@discussions.microsoft.com> wrote in message news:88EC7019-045F-4EF...

How to dump smartlist definition data
We are migrating from GP 8 to GP 10 and we need to go through and cleanup the existing smartlists. I would like to be able to query the definition tables for smartlist and provide the user community a spreadsheet that contains each of the "favorites" created under each of the out-of-the-box smartlists so they can let me know which ones are not used anymore and can be cleaned up. The ASIEXP81 table seems to house the Favorites in it so I am almost there. However, I cannot find where to join to the main smart lists so these favorites can be grouped. Does anyone know how to ...

Erratic results from query criteria
I am getting different results from running the same query with the same selections. One moment it is all behaving as expected, the next it has gone haywire. (I have done what appears to me to be EXACTLY what I have done in another database, where it works perfectly every single time.) In a query I have, amongst others, the following fields: Category SubCategory Company I want to be able to select any OR ALL of the relevant fields. I have the following criteria: Like "*"&[Type Category otherwise leave blank for ALL]&"*" Like "*"&a...

Update Query ?
Is there a way to 1) Assign events when adding in data thru an update query for example if you append a bunch of data into a table could you then do some kind of an update query to say if there is an initial event and no others tag this one Renewal 1 etc.. the only real data you have to go on would be Customer A and the total amt .. the event, renewal event and the delta would all need to be added in example: Say Customer A comes in with an initial deal then Customer A renews their deal So, the data would look like when you're done.: Year Custo...

Updating Data from two different worksheets
I have two worksheets, General Ledger and Out Ledger. The general ledge lists our inventory according to a LOT ID and the total number of item in that lot; i.e. column A: Lot ID, column B: Total Number of Pieces column C: Balance The Out Ledger lists the number of items sold from a particular lot i.e. column A: Lot ID, column B: Number Sold I want to be able to calculate the Balance in the General Ledger give the Number Sold in the Out Ledger. I am having difficulty in makin sure the Lot ID's match up and that the proper cells are referenced. Any suggestions/advice would be greatly appr...

how to assign color for a data type
Hi i have made a chart for sales of 12 items in 28 outlets over a period of 4 years (ie total sale for the year), not all outlets have all 12 items. the outlest only stock what they think they can sell. so they may have sold an item one year, and not sold it next year. when I make a bar chart for each outlet I have 4 bars, one for each year, and each item is stacked up on the other on the bar, now only problem is that when i select another store, the bars all change colors, as in even if item 7 were there in both shops, the color representing item 7 is diffrent. In other words, irrespective o...

Making data span 2 columns
Hi, I'm new to this community and new to the RMS system. I am trying to modify the PrintTransactionDetails sub in the receipt.xml to be 2 columns and put the entry.description information onto another row. The person who writes the descriptions likes to be wordy and I need the entire 40 columns in order to hold the text. I changed the 3 columns into 2 with a format of 71% for the item number or description and 29% for the sales amount. The description and a null field occupy the first row and the item number and amount occupies the second row. I have the transaction d...

design query match anywhere?
In the design query I want to match the letters "ABC" anywhere in the column 'description'. I could not get instr to work by using: InStr(description, "ABC")) > 0 How else can I match ABC (upper and lowercase) to anywhere in my 'description' column? Thanks! Are you saying you put that InStr bit as a criteria under your Description field in the query designer? Try putting Like "*ABC*" as the criteria instead. Alternatively, you could add a computed field to the query InStr([Description, "ABC") and then put >0 as the ...

Matching data in tables
I have two tables of data, some of the rows are duplicated in these tables i want to find the data that is different. will an advanced filter do this? Chip Pearson has lots of info about working with duplicates at: http://www.cpearson.com/excel/duplicat.htm Jo Davis wrote: > > I have two tables of data, some of the rows are duplicated in these tables i > want to find the data that is different. > > will an advanced filter do this? -- Dave Peterson Cheers Dave "Dave Peterson" wrote: > Chip Pearson has lots of info about working with duplicates at: >...

keep value if formula has no data
I have a worksheet that automatically updates everyday and works some calculations for me. How can I get the formula sheet to keep the value from the previous day if there is no data today. Because now it is filling in all my cells with zeros. Thanks -- Nicki Taylor Post your formula. -- Regards, RD ---------------------------------------------------------------------------- ------------------- Please keep all correspondence within the Group, so all may benefit ! ---------------------------------------------------------------------------- ------------------- "NTaylor" <...

Unexpected Error- Running Advance Find Query
I am getting a message that says "Unexpected Error An Error has occurred" when I am running an advanced find query on two custom entities. It seems to be when I have certain custom fields included in my view that the query errors out. Any help on this would be greatly appreciated. Thanks so much. Just wanted to add that I seem to get errors when there is a 0.00 amount in these fields... "TJ" wrote: > I am getting a message that says "Unexpected Error An Error has occurred" > when I am running an advanced find query on two custom entities. It se...

CRM Data Migration 11-03-04
Hi, I would like to enquire how long will I need to take to migrate data from a table in an access database to MS CRM? For instance I wana migrate 10 columns in customer table in access database to MSCRM. How much effort need to be done? As I have not done any data migration before. So wat do I need to do n prep myself in order to start the data migration for my customer? any guidelines to assist me? Kindly assist me pls. thanks Johnson Dear Johnson, You should take a look at the data migration framework. This is on a cd which is delivered with crm, or you can download it from t...

pass through query
If a combobox is populated by a pass-through query, does it requery every time the form is closed and reopened? Thanks, Sam Yes. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Sam wrote: > If a combobox is populated by a pass-through query, does it requery every > time the form is closed and reopened? > Thanks, > Sam ...

How do I replicate data from primary worksheet to other worksheet
I want to copy data from my primary worksheet (which will be modified frequently) to other my other worksheets (which have filters applied to the data) I want these to be updated automatically. I have already set up the filters on the other worksheets. To put you in the picture, it is for a stock room system, with the current stock in the primary sheet and the stock per shelf in the other worksheets. Thankyou Your help is warmly welcomed! Hi Jon Why are you doing the filtering on a copy? Why not just filter the original? If you do want to copy all data to another sheet, then on Sheet2...

SQL2008 and Access 2007 Data Project
I am have SQL 2008 and Microsoft office 2007. I created a adp DB that connects to a DB in SQL 2008. Everything seems fine but I can’t edit the records in the Microsoft adp database. I have full rights to the db so that is not the issue and. In fact I go into SQL and edit the records without any issues. Another odd thing is I do have a command button set up that runs a delete stored procedure in SQL and updates a table in SQL and this works fine. Has anyone ran into this problem and if so is can you point me to the solution? Thanks Andy > Has anyone ran into this...

a count field in a query?
Hello, I have a query in which I would like to create a field which increments by 1 for each record selected, so if there are 10 records selected by the query, this column would show numbers 1 to 10. Ideally I would like to have some text in front of each number, say invoice1, invoice2 etc. From a previous posting I realise that this is frowned upon but it would be the simplest solution for my problem! How can I do this? Thanks Geoff On Mon, 03 Dec 2007 08:54:00 +0000, Geoff Cox <<>> wrote: >Hello, > >I have a query in which I would like to create a field which >...

Saving Username and Pass with Web Queries
I am pulling data from a website that requires you to provide a usernam and password everytime you visit the site. Excel has cachin capabilities, but everytime you close excel and try and open up th spreadsheet again, it can't login. What is the fix for this? Thanks, Hend -- Message posted from http://www.ExcelForum.com Bump! --- Message posted from http://www.ExcelForum.com/ ...

Conditioning formating a data value to change to a color
Hello, What I am trying to do is lets say I have a bunch of numbers in column F (for illustration purposes I will only show one number) and what I would like if any of the numbers in column F are greater than 300 I want it to change the color of that number to red automatical (See example) date time day evening night 24hr. Totals 3/12/04 8:00 100 12:00 300 4:00 600 1000 (change to red) I have no problem with changing the number to red m...

Birthday query for many children in one record
I have a database for the church, it has one main flat table only. Each record for the parents have field for child1 name, child1birthday, child2 name, child2birthday, child3 name, child3birthday - up to 5 children. I am having difficulty trying to get a report to list the birthdays of the children like this parent name, child 1 name, child 1 birthday month etc. so you get something like this:- Parent John Smith, child Mary Smith January 3 Parent Fred Jones, child Bert Jones March 4 Parent John Smith, child Jane Smith March 6 Parent Harry Brown, child Jane Brown March 6 Parent Bert Taylor,...

Unresponsive Query Wizard
Hi there, I have an Excel 2003 user who is using a spreadsheet that pulls data from our SQL server. When he opens it and refreshes the data it is fine, it pulls the current data, but when he tries to edit the query, the Query Wizard does not appear, he can see it on the task bar, but when he switches focus using task manager everything is greyed out and nothing works. I have tested the file from my computer and it is fine, which suggests a problem with his machine or installation. Does anyone have any ideas? Cheers, Steve Dooza wrote: > Hi there, > I have an Excel 2003 user who...

Import data from a web page
I've read the suggestions about this topic and none of them work. The only thing I am able to do is manually copy and paste data from a website to my Excel worksheet. In the past, with the previous version of Excel I had a web query that worked but now I just get an error message that says the query retrieved no data. Following the instructions in the error message window yields no results. Has anyone else had this problem and arrived at a solution? What version of Excel, previous version is not descriptive of what you had what you have now. And it possibly does not matter. In...

Another simple query
Dear all, I have a table that contains first names and last names in different fields. Is there any way to write a query that will give as a result the first name and last name in the same field? I hope this makes sense. Thanks in advance! SELECT [last_name_field] & ", " & [first_name_field] AS whole_name FROM [your_name_table] Change the field and table names to whatever your actual fields and tables are. Cheers, Jason Lepack On Apr 23, 9:47 am, Homer <peter.a.r...@googlemail.com> wrote: > Dear all, > > I have a table that contains first names an...

Sorting multiple columns that have similar data
I am trying to sort a worksheet where multiple colums contain the same type of data; the data duplicates down a column but not across a row. I can't figure out how to sort/filter for any rows that have that duplicate data in any column. Instead I wind up sorting the first column I need, which only allows you to sort the remaining rows. ...

Query query
I am trying to create a new field in which it shows the sum total of 10 fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest way to do this? -- Joe NewFieldName: [Charge Time] + [Charge Time 2] + [Charge Time 3] .... etc -- Good Luck BS"D "joet5402" wrote: > I am trying to create a new field in which it shows the sum total of 10 > fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest > way to do this? > -- > Joe I tried this, and it doesn't work. Is there something I'm forgetting? -- Joe ...