Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Returning text rather than ID
Daniel Golden 
     
20 months ago
I have the following set up in SQL for a union query:

SELECT [ALL USERS Completed Query].[Case Number], [ALL USERS Completed Query].[Date Received], [ALL USERS Completed Query].[Date Due], [ALL USERS Completed Query].[Date Closed], [ALL USERS Completed Query].Unit, [ALL USERS Completed Query].[Unit/Center Incident Number], [ALL USERS Completed Query].Allegation,[ALL USERS Completed Query].Status,[ALL USERS Completed Query].[Needed Item],[ALL USERS Completed Query].[Date Item Requested],[ALL USERS Completed Query].[Item Requested From],[ALL USERS Completed Query].[Assigned Investigator],[ALL USERS Completed Query].[UserID]
FROM [ALL USERS Completed Query]
WHERE ((([ALL USERS Completed Query].[Date Received]) Between Date() And Date()-6) AND (([ALL USERS Completed Query].[Date Closed]) Between Date() And Date()-6))


I am trying to get the "Assigned Investigator" to return a name rather than the ID number for the investigator...
Alex Hedley  @Reply  
           
20 months ago
JOIN your UserT to the current Query and pull in their Name.
Alex Hedley  @Reply  
           
20 months ago
Is [ALL USERS Completed Query].[Assigned Investigator] the ID?
Daniel Golden OP  @Reply  
     
20 months ago
All data from all relevant tables (Unit/Center Reviews, Unit/Center Investigations, etc.) is pulled by the All Users Completed Query which is a union query. I will try to join the UserT to the underlying union query for the report.
Daniel Golden OP  @Reply  
     
20 months ago
Alex, this is my complete SQL on the Union query I am trying to get the name of the assigned investigator in...

SELECT [ALL USERS Completed Query].[Case Number], [ALL USERS Completed Query].[Date Received], [ALL USERS Completed Query].[Date Due], [ALL USERS Completed Query].[Date Closed], [ALL USERS Completed Query].Unit, [ALL USERS Completed Query].[Unit/Center Incident Number], [ALL USERS Completed Query].Allegation,[ALL USERS Completed Query].Status,[ALL USERS Completed Query].[Needed Item],[ALL USERS Completed Query].[Date Item Requested],[ALL USERS Completed Query].[Item Requested From],[ALL USERS Completed Query].[Assigned Investigator],[ALL USERS Completed Query].[UserID]
FROM [ALL USERS Completed Query]
WHERE ((([ALL USERS Completed Query].[Date Received]) Between Date() And Date()-6) AND (([ALL USERS Completed Query].[Date Closed]) Between Date() And Date()-6))
UNION SELECT [ALL USERS Pending Query].[Case Number], [ALL USERS Pending Query].[Date Received], [ALL USERS Pending Query].[Date Due], [ALL USERS Pending Query].[Date Closed], [ALL USERS Pending Query].Unit, [ALL USERS Pending Query].[Unit/Center Incident Number], [ALL USERS Pending Query].Allegation,[ALL USERS Pending Query].Status,[ALL USERS Pending Query].[Needed Item],[ALL USERS Pending Query].[Date Item Requested],[ALL USERS Pending Query].[Item Requested From],[ALL USERS Pending Query].[Assigned Investigator],[ALL USERS Pending Query].[UserID]
FROM [ALL USERS Pending Query]
WHERE ((([ALL USERS Pending Query].[Date Received]) Between Date() And Date()-6) AND (([ALL USERS Pending Query].[Date Closed]) Is Null))
ORDER BY [ALL USERS Completed Query].[Assigned Investigator];


This query shows all cases that ALL users have either completed or still have pending which were assigned in the previous week. This is where I am running into the issues with showing the name rather than ID. I'm not sure how to do a join for a union query like this...
Alex Hedley  @Reply  
           
20 months ago
Build a second Query using the UNION one as your starter.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/3/2026 8:23:15 AM. PLT: 0s