View Full Version : Text String Query


Surjer
10-22-2001, 10:58 AM
I have a table that consist of:

Feature ' string
Northing ' Double
Easting ' Double
Elev ' Double
MH_ID ' String ' "KEY"
Inventory ' String
Comment '

Now, each MH_ID is unique and contains two parts

MH_ID = 123-s456
123 = Landllot
-s = indicates sewer
456 = Unique ID

What I want to do is query what landlots I have..

I used the left function
Ex...

SELECT Left([Final_MH]![MH_ID],3) AS Expr1
FROM Final_MH;

But this returns each record's landlot''Duplicates
Ex... LandLot 123 might have 600 Manholes

How can I produce just one instance of each LandLot?

Thanks,
Jerry

shacket
10-22-2001, 11:29 AM
Insert the word "DISTINCT" in your statement:

SELECT DISTINCT Left([Final_MH]![MH_ID],3) AS Expr1
FROM Final_MH;

Surjer
10-22-2001, 11:42 AM
Thanks a million *....

Jerry