Criteria in a query
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Criteria in a query
In a query, which show a list of carnival entrants, there is a "year" field - to denote which procession year the data applies to. When in the design view I enter the criteria = 2010, save the query, and go into view. But there are no entries displayed, despite there being 6 entries to 2010. Help please
-
- 3StarLounger
- Posts: 331
- Joined: 11 Feb 2010, 03:55
- Location: Land O Lakes, FL
Re: Criteria in a query
You say there is a "year" field in query, but is this a "year" field in the table (and is it numeric) or are you extracting the year from a date? Are there any other selection criteria? Maybe you could post the query, just in case.Sgte wrote:In a query, which show a list of carnival entrants, there is a "year" field - to denote which procession year the data applies to. When in the design view I enter the criteria = 2010, save the query, and go into view. But there are no entries displayed, despite there being 6 entries to 2010. Help please
Mark Liquorman
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: Criteria in a query
The year field is just the year number, viz 2010. I've attached the data
-
- 3StarLounger
- Posts: 331
- Joined: 11 Feb 2010, 03:55
- Location: Land O Lakes, FL
Re: Criteria in a query
I don't see the attachment.Sgte wrote:The year field is just the year number, viz 2010. I've attached the data
Mark Liquorman
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: Criteria in a query
Ooh.... can't upload the dab "The extension mdb is not allowed" How does one upload a query then?
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Criteria in a query
Create a zip file containing the database, and attach the zip file to your reply.
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: Criteria in a query
Aah Haa
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Criteria in a query
The EntYr field is a lookup field - it links to the YearID field in tblYears, which has values 1, 2, 3, not 2008, 2009, 2010. It displays the corresponding year because it uses a combo box that hides the YearID column.
There is not much point in having the YearID field in tblYears, since Year itself is a number field. I'd delete the YearID field and simply use Year. You'll have to delete the relationship between tblYears and tblEntries before deleting the YearID field, then create a new relationship on Year vs EntYr. You'll have to update the values of EntYr.
There is not much point in having the YearID field in tblYears, since Year itself is a number field. I'd delete the YearID field and simply use Year. You'll have to delete the relationship between tblYears and tblEntries before deleting the YearID field, then create a new relationship on Year vs EntYr. You'll have to update the values of EntYr.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 331
- Joined: 11 Feb 2010, 03:55
- Location: Land O Lakes, FL
Re: Criteria in a query
This is one of the hazards of using a Lookup field. It hides the real value of the field and displays the lookup value, which is just confusing when you want to use it in a query. My basic suggestion is "don't use them"; you can always create combobox in your forms to handle the lookup (and you shouldn't being doing dataentry directly into a table anyway).
Mark Liquorman
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.
-
- 3StarLounger
- Posts: 287
- Joined: 09 Mar 2010, 23:16
- Location: Canberra Australia
Re: Criteria in a query
I agree with you about not using lookup fields, but it does not have to hide the real value.Mark L wrote: It hides the real value of the field and displays the lookup value, which is just confusing when you want to use it in a query.
The real value is only hidden if you accept the default column widths, which puts a column width of 0 on the first column.
Regards
John
John
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: Criteria in a query
Thanks all for the help and comments. Really appreciated.