473,463 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't sort a query field

32
I created a query to show records that has a field called 'recommendations.' I have to track the recommendations that haven't been corrected by a specific date. I've had no problem with that, since I can track them using 'is null' in the completion field. However, since more than one person in the table can have the same recommendation, I'd like to have the query only show unique recommendations that have not been completed and not show the same recommendation for each individual that may have it in his record. I can't find any criteria that will show the records that need completion unless that field (recommendations) comes up two, three or four times. I can't use distinct record in the property sheet because there will be duplicates in the other field. I just want the recommendations field to be unique.

Thanks for any help with this!

irene
Apr 3 '13 #1

✓ answered by zmbd

Thank you... Due to projects here in the lab, I won't have a lot of time today to oversee this; however, someone will be along shortly to help.

One thing to note: [C-CONSUMER TABS#] it is highly advisable to not use anything other than alphanumeric, the underscore, and more recently the space (although I still avoid them) in field and other names. The hash/pound charactor is a reserved token for many SQL and other programing languages and even though it is within the braces - using it within a name may result in a lot of issues.
Access 2007 reserved words and symbols:: "Access reserved symbols
The following symbols must not be used as part of a field name or as part of an object name: . / * ; : ! # & - ? " ' $ % "

5 2220
zmbd
5,501 Expert Mod 4TB
eye707:
We need your table name, fields, and types
[tbl_name]![field1_name] - PK, autonumber
[tbl_name]![field2_name] - FK to [tbl_name2]1:M, numeric long
etc...

We also will need to take a look at your SQL:
Open this webpage.
Click on the [CODE/] button in the format toolbar - this will insert a pair of code tags for you.
Open the query in design view. Right click in the table area and in the context menu select SQL View.
Select all of the text shown in this view.
Copy (<ctrl><c>)
Come back to this thread, place the cursor between the code tags you inserted earlier... paste (<ctrl><v>).

Also a small example of your data would be helpfull... say 5 to 10 records that represent your dataset.
Apr 3 '13 #2
eye707
32
Expand|Select|Wrap|Line Numbers
  1. SELECT [IRC RECCOMPLIANCE FOLLOW UP].ID
  2.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-CONSUMER TABS#]
  3.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-CONSUMER LAST NAME]
  4.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-CONSUMER FIRST NAME]
  5.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-IRC DATE]
  6.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-RECOMMENDATION]
  7.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-DUE BY]
  8.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-COMPLETE]
  9.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-PERSON RESPONSIBLE]
  10.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-COMPLIANCE CHECK DATE]
  11.    , [IRC RECCOMPLIANCE FOLLOW UP].[C-REMARKS]
  12. FROM [IRC RECCOMPLIANCE FOLLOW UP]
  13. WHERE ((([IRC RECCOMPLIANCE FOLLOW UP].[C-COMPLETE]) Is Null));
  14.  
I copied my table info into Excel because I had to remove private info. Let me know if you need to see it in another way. (I just copied the whole thing back and pasted it into an Excel sheet to see if it would go back into columns and it came out fine.) As you can see, for each consumer we have, we have to log the recommendations made at their incident review committee so that they can be used in other reports that join all the info from different tables together...

Expand|Select|Wrap|Line Numbers
  1. ID    C-CONSUMER TABS#    C-CONSUMER LAST NAME    C-CONSUMER FIRST NAME    C-IRC DATE    C-RECOMMENDATION    C-DUE BY    C-COMPLETE    C-PERSON RESPONSIBLE    C-COMPLIANCE CHECK DATE    C-REMARKS
  2. 1    29795    xx    Michael    2 /5 /2013    xx employment with the agency should be terminated    12/18/2012    YES    HR Department        
  3. 2    29795    xx    Michael    2 /5 /2013    During attendance, include asking the consumers if they have their identification with them.  This should occur daily so that the consuemrs learn to always have ID on their person    2 /11/2013        xx, DH Coord.        
  4. 3    29795    xx    Michael    2 /5 /2013    The coordinators will discuss and decide on the type of ID the consumers should carry, i.e., wristlets, badges, etc., home.    2 /7 /2013        DCS (FRF)        
  5. 4    15660    xx    Tyree    2 /5 /2013    xx employment with the agency should be terminated    12/18/2012    YES    HR Department        
  6. 5    15660    xx    Tyree    2 /5 /2013    During attendance, include asking the consumers if they have their identification with them.  This should occur daily so that the consuemrs learn to always have ID on their person    2 /11/2013        xx , DH Coord.        
  7. 6    15660    xx    Tyree    2 /5 /2013    The coordinators will discuss and decide on the type of ID the consumers should carry, i.e., wristlets, badges, etc., home.    2 /7 /2013        DCS (FRF)
Apr 3 '13 #3
zmbd
5,501 Expert Mod 4TB
Thank you... Due to projects here in the lab, I won't have a lot of time today to oversee this; however, someone will be along shortly to help.

One thing to note: [C-CONSUMER TABS#] it is highly advisable to not use anything other than alphanumeric, the underscore, and more recently the space (although I still avoid them) in field and other names. The hash/pound charactor is a reserved token for many SQL and other programing languages and even though it is within the braces - using it within a name may result in a lot of issues.
Access 2007 reserved words and symbols:: "Access reserved symbols
The following symbols must not be used as part of a field name or as part of an object name: . / * ; : ! # & - ? " ' $ % "
Apr 4 '13 #4
eye707
32
Thanks for the hash tag tip; I'll change that...
Apr 4 '13 #5
Rabbit
12,516 Expert Mod 8TB
So you don't want the results in post #3? What is it that you want to show instead? I have trouble following your first post.
Apr 4 '13 #6

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

Similar topics

5
by: Otie | last post by:
I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays , , and and that sorts ASCENDING on the ...
11
by: MLH | last post by:
I have a query field... Description: & "2-tone" When I run it, the output in that field is empty. If I change the name to MyDescription - it works fine. I noticed the query field has a...
2
by: Yeah | last post by:
I have a simple fill-out form with three fields, in this order: Name, E-mail, and Comment. But when I receive the E-mail containing the form data, the fields are listed backwards (Comment, E-mail,...
2
by: visionstate | last post by:
Hi there, Is there a way of searching a sub-form (reading from a query) without writing what is exactly contained in the query field. For example if I had a 'Finance Manager' in the query but just...
1
by: Nelly | last post by:
Please help! I am trying to sort a query by a field calculated as e.g. / I keep getting an error about subqueries not allowed for this type of expression, but only when I set to sort. I...
2
by: missnaughton | last post by:
Hi I'm designing a query for our hockey coach to print out players' names to stick on game sheets. I could sort the query results based on Jersey number, but the problem is the 2 goalie names...
8
by: MLH | last post by:
Sometimes it works and sometimes it crashes. If I want "Today is " & Date$ & "." to appear in a query field, why might it work sometimes and not others? Would I be better to call a FN? Say,...
11
by: dowlingm815 | last post by:
the following code is generating an error; Mircosoft Access cant find the field '|" referred to in your expression" any suggestions would be appreciated. Private Sub...
2
by: JaketheSnake27 | last post by:
I'm trying to define a field in a query using an expression. Part of that expression involves using public variables. First of all, is it possible to use variables in a query field? And if it is,...
9
by: neelsfer | last post by:
When i try and add up 3 fields in a query and 1 field is blank, i a get #Error.(due to complicated string problems) This is fine, but now i want to sort the rest of the records that do add up, and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.