Hi Kobi.
That allowed the program to run, but unfortunatly it returns no
results, whenever i run it. Even for results i KNOW should work. Just to
be extra clear, say for example i'm looking for asset id 123456, this
won't be in all four of the tables it will only be in one of the four
tables, say just the Hydrant table for example. Does this make it any
different?
Thanks
Jonathan
>>> "Kobi Abrahami" <[EMAIL PROTECTED]>
Hi Jonathan
You should add the name of the table to your select sentence
This way:
SELECT *
FROM VALVES,HYDRANTS,METERS,PRV
WHERE VALVES.ASSET_ID = HYDRANTS.ASSET_ID AND
HYDRANTS.ASSET_ID=METERS.ASSET_ID AND
METERS.ASSET_ID=PRV.ASSET_ID AND
VALVES.ASSET_ID=assetid
INTO assetidresult
Bye
Kobi
>>> "Jonathan Gledhill" <[EMAIL PROTECTED]> 07/01/2004
12:01:12 >>>
Hi
Wonder if one of you guru's could help me with this relatively simple
query!
I'm trying to search through several tables called VALVES, HYDRANTS,
METERS and PRV. They all have one field in common called ASSET_ID in
which a unique id number is held.
What i want to do is through one button, search for an input asset id
number through all these four tables at once.
I'm able to make it work through a seperate mbx for each table, but
this is a nuisance if i need to update anything and I tried to write
something that would search all 4 tables in one go. I assumed
(probably
wrongly) that as i'm not bothered about joining these tables in any
way
and that as they all contain an ASSET_ID field that i could just
search
them all at once, like this
**************
SUB asset_search
DIM assetid AS STRING
DIALOG
TITLE "Asset ID Search"
CONTROL STATICTEXT
TITLE "Enter Asset ID to Search For"
CONTROL EDITTEXT
INTO assetid
CONTROL OKBUTTON
CONTROL CANCELBUTTON
SELECT *
FROM VALVES,HYDRANTS,METERS,PRV
WHERE ASSET_ID = assetid
INTO assetidresult
BROWSE *
FROM assetidresult
END SUB asset_search
**************
But when i run the program, i get warned that there is "No Join
Specified Between Tables VALVES and HYDRANTS, invalid join in WHERE
clause".
I'm now stumped and cant seem to find an answer in the books... Could
anyone suggest how i could search these tables in one go?
Thanks
Jonathan
**********************************************************************
CONFIDENTIALITY
The information contained in this message and any attachments
are intended solely for the use of the individual or entity to whom
they are addressed. It may contain privileged or confidential
information. If you are not the intended recipient you must not
copy, distribute or take any action in reliance on it. If you have
received this e-mail in error please notify the sender. Thank You
This e-mail message has been swept by MIMEsweeper for the
presence of known computer viruses.
**********************************************************************
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9770
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9772