View Full Version : Misbehaving queries
Lee Carson
2nd December 2004, 04:13.23 PM
if you have several queries with criteria listed, if any of these criteria receives a positive hit, the record will fill with all the fields, even when much of those fields are not metting their criteria/ Then how does one establish a priority of severial criterias,
Lee
Rick
2nd December 2004, 04:21.51 PM
You need to give a good example or explain what you are referring to.
Donnie
2nd December 2004, 05:27.00 PM
Lee--
Criteria that is filled out on the same ROW down there will create an AND statement. Suppose you want to find a list of all the horses running on a specific date that are all breaking from post position #4 (cause it is your lucky number). In the top ROW you would enter under the date field (tDATE) the date you need to see and under the post field (nPPO) you put a number 4. Because these are on the same line, you get all horses running that date that are breaking from the post number 4.
There is no order of priority when assigning criteria. BUT, when sorting it will sort from the first field it finds on the left moving to the right. So if you have them in order from left to right: DATE, TRK, PRG, and you have acsending selected in DATE and PRG, then it will FIRST sort by date, then within those matching dates it will sort by PRG. (working left to right in sort levels)
Lee Carson
3rd December 2004, 01:18.26 PM
Your point regarding rows is true. And traditionally we first list Date, Track and Race #
My concern is restricting only those races which are claimers "nCLA"=2 Additionally , I was attempting to further restrict the range of Kline and vi. I assumed these should be as expr:in the filed column, and Access tried to provide the same, but neither I nor Access could make anything work.
Lee
Rick
3rd December 2004, 01:29.26 PM
Lee,
I quit trying to guess why people are having problems with Access.
Open up your query in Sql View. Copy and paste it into an email and I will take a look at it if you like.
ricks231@cox.net
MikeDee
3rd December 2004, 02:06.45 PM
Lee
to limit your query to ncla =2 you put the value of 2 in the critera row under the ncla field. To limit to a range of vi values you can put the range in the criteria row of the nvi field. For example if you want a range of vi 20 to 30 you would put >=20 and <=30 in the criteria row of the nvi column.
When you run this you would only see the races with a ncla value of 2 AND a vi vlaue between 20 and 30. Continuing to add filters like a kine filter will continue to reduce the number of races that will meet the requirements.
Putting the criteria values on the same row is a "AND" query. Each critera must be met for a race to pass the filter.
Putting the criteria on different row is a "OR" query. All races that meet one or the other critera will pass the filter.
Lee Carson
3rd December 2004, 03:27.55 PM
The nCLA=2 = I am getting the whole farm - must be something i must redo re the query- Do I have to start from the beginning with every new query ? meaning changing 00today's file content must I redo the ALL_txt over again ? etc etc? Once this total procedure is done, why won't I be able to make another new query from that position?
Lee
Victor
3rd December 2004, 03:46.17 PM
= nothing!
just put a 2 in the criteria field.
Don't put no equals sign . . .
Victor
3rd December 2004, 05:14.52 PM
Hang in there Lee,
If I can do it - and I can - then you can do it too.
My IQ is way below the top.
hurrikane
4th December 2004, 07:06.48 AM
Lee,
really, the easiest thing is to go to View>SQL
this will show you the SQL statement instead of the design view.
copy the text and paste here or email it to me or someone else.
can be fixed in 2 min. really.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.