473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

query statement

2
Hi all,
I recently started a business selling 1st edition books and decided to use Access for my records. I have a limited past experience with Access and am OK with the basics of creating tables, forms, reports and basic queries.

I am trying to create a query to extract records by AUTHOR SURNAME. Everything I've tried so far requires me to type the FULL surname and forename to extract the info. The "author" column contains the full name, eg "DEIGHTON Len" (no comma).

Can anyone help, please?
Oct 23 '07 #1
2 1140
missinglinq
3,532 Expert 2GB
Not sure exactly how you're doing this query, but if your author names are always in the same format, i.e. "Deighton Len" then

Expand|Select|Wrap|Line Numbers
  1. AuthorSurname =  Left(AuthorWholeName,instr(AuthorWholeName, " "))
will parse out the surname, and you can use this.

If you're using a query as a base for a form, and are then searching to pull up your data, you could also use the same thing to create a calculated surname field in your query. In a new field enter

Expand|Select|Wrap|Line Numbers
  1. AuthorSurname: Left(AuthorWholeName,instr(AuthorWholeName, " "))
and now you can search on just the surname field.

Welcome to TheScripts!

Linq ;0)>
Oct 23 '07 #2
LABMAN
2
Hi!
Many thanks for your welcome and for your prompt reply.

OK, well I did say I only had limited experience of Access!!

What I am trying to do is produce a report detailing a particular author's books that I have in stock. So I created a parameter query but the only parameter I used that gave me any sort of result was typing "Like[DEIGHTON Len]" (my quotation marks). I can then type in any author in the parameter box with the desired result. However, I thought I would be able to create a query so that I can just type the Surname, or even simply "DEI" to get the desired result.

The other thing is, I assume your solution was using Visual Basic. Now i'm not asking for a tutorial, but could you please give me a clue as to how to use your suggestion! I would be ever your servant!!!!

kindest regards
Oct 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: NotGiven | last post by:
I need to build a query based on what the user checks in the form. For example, if the user does not check certain fields, I don' tneed to use those in the query statement. Any ideas how to...
4
by: George Stout | last post by:
First off I do not know alot about writing queries to an Access Database from an ASP page. This is why I need help. I have an Events database for 6 colleges in our metro area. On the homepage I...
0
by: lowellturner | last post by:
We recently had to reload an app to a Linux server from its Window counterpart. I've tried setting the lower case global in my.cnf to al three values, but none work. Previously, this worked fine....
4
by: Kavitha | last post by:
I have a Users table which contains a nvarchar column LastName. The first query below returns me all the records with LastName containing "opez" or "ópez" in them. But the second query returns...
3
by: Kangan | last post by:
Hi, Is there a way to display just the first five rows of the query stt result in DB2. I know that there is something called select Top 5 * from tablename in SQL Server 2000. Is there a wayaround,...
3
by: roberto | last post by:
I have a table (ORDERS) with this kind structure (this is not the really table): OrderId Product Amount Agent1 Agent2 Agent3 ________ _______ ______ ______ ______ ______ 000001 ...
2
by: Joe Weinstein | last post by:
Hi all. I would like to know what the fastest, lightest weight query/SQL a client can send to the DBMS. I want to do this occasionally from a Java client to verify the current health of an...
7
by: ljungers | last post by:
Have Form-1 with 3 text boxes and 1 command button. With any of the 3 boxes filled out and button is clicked, a Macro is performed that Opens a Query that has a WHERE clause that uses the 3 test...
2
by: tishyouwish | last post by:
I have been trying to get a query to look in a different column in order to categorize information for a report if the column that it is pulling from currently is null. Please Help... Beginner in...
6
by: simonyong | last post by:
1. select * from MyDataBase 2. select count(*)as total_child,direct_mngr_personnel_number as personnel_number from MyDataBase group by direct_mngr_personnel_number both of the query statement is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.