×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help with a query to display certain records in a report

Help with a query to display certain records in a report

Help with a query to display certain records in a report

(OP)
Hi there.
I am having problems with displaying the proper information in a report.  I want to be able to edit the source of the query. I dont like just selecting fields and stuff.  I want to be able to actually write the query myself.  If anyone knows how to do this let me know.  In the mean time I want to be able to select three records from the same table based on the id.  The query should be able to accept 3 id numbers and then return the records based on those id numbers.  If anyone can suggest anything please let me know.

RE: Help with a query to display certain records in a report

(OP)
Sorry guys.  I figured out how to do both.  Right click select sql and I use a union with three select statments

SELECT dbo_tblProject.fpjID, dbo_tblProject.fpjFirmID, dbo_tblProject.fpjProjNum, dbo_tblProject.fpjName, dbo_tblProject.fpjAddress, dbo_tblProject.fpjCity, dbo_tblProject.fpjProv, dbo_tblProject.fpjCountry, dbo_tblProject.fpjPostalCode
FROM dbo_tblProject
WHERE (((dbo_tblProject.fpjID)=[ProjID]) AND ((dbo_tblProject.fpjFirmID)=[FirmID]))
UNION
SELECT dbo_tblProject.fpjID, dbo_tblProject.fpjFirmID, dbo_tblProject.fpjProjNum, dbo_tblProject.fpjName, dbo_tblProject.fpjAddress, dbo_tblProject.fpjCity, dbo_tblProject.fpjProv, dbo_tblProject.fpjCountry, dbo_tblProject.fpjPostalCode
FROM dbo_tblProject
WHERE (((dbo_tblProject.fpjID)=[ProjID2]) AND ((dbo_tblProject.fpjFirmID)=[FirmID]))
UNION SELECT dbo_tblProject.fpjID, dbo_tblProject.fpjFirmID, dbo_tblProject.fpjProjNum, dbo_tblProject.fpjName, dbo_tblProject.fpjAddress, dbo_tblProject.fpjCity, dbo_tblProject.fpjProv, dbo_tblProject.fpjCountry, dbo_tblProject.fpjPostalCode
FROM dbo_tblProject
WHERE (((dbo_tblProject.fpjID)=[ProjID3]) AND ((dbo_tblProject.fpjFirmID)=[FirmID]));

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close