Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a query to display certain records in a report

Status
Not open for further replies.

bryant89

Programmer
Nov 23, 2000
150
CA
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.
 
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]));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top