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!

Query for Displaying records

Status
Not open for further replies.

srpatel

Programmer
Mar 7, 2006
41
GB
Hello All,

I need some help on enhancing my queries/sql statements. I have a table called tblDTTAssetFunction.

Table Details:

AssetFunctionID (PK)[tab]LocationType (text)[tab]DTTAssetFunction (Text)
1009768[tab][tab]Station[tab][tab]Lift

There are different location types used as well. Below is the SQL statement from the DTTAssetFunction combo box on my form.

Code:
SELECT DISTINCT tblDTT_AssetFunction.AssetFunctionID, tblDTT_AssetFunction.LocationType, tblDTT_AssetFunction.DTTAssetFuntion
FROM tblDTT_AssetFunction
ORDER BY tblDTT_AssetFunction.LocationType, 
tblDTT_AssetFunction.DTTAssetFuntion;

Currently when I select something from the drop down this is how it displays data:

Station | Storage Area
Station | Lift
Station | Escalator

Station = Location Type
Lift = DTTAssetFunction

In the table I can currently only see Station. I need to have both visible or atleast when I run a query I would like to have the full information displayed. It is storing the correct one but to view which one is selected I have to always click on the drop down which is abit annoying.

The query I run for displaying all my data is below, if it is easier to modify this then I would really appreciate some help on enhancing the query.

Code:
SELECT AllDTT.DTT_UniqueID, AllDTT.Asset_Number, AllDTT.Depth_Meters, AllDTT.DateOfCommissioning, AllDTT.DTTAssetFunction, tblLine.Line
FROM AllDTT, tblLine
WHERE AllDTT.LineID=tblLine.LineID;

Thank you
Have a awesome day
srp
 
Add the tblDTT_AssetFunction table to your query with the proper join.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top