[AccessD] Comparing Tables

Mark A Matte markamatte at hotmail.com
Tue Sep 16 14:33:44 CDT 2008


How about just an IIF statement...if you are only trying to differentiate between in 1 table...and not the other.

*******************
SELECT tblMasterWell.ID, IIf(IsNull([tblAutoEQ].[ID])=True,"M","A") AS Type
FROM tblMasterWell LEFT JOIN tblAutoEQ ON tblMasterWell.ID = tblAutoEQ.ID;
*******************

Good luck,

Mark A. Matte


> From: Chester_Kaup at kindermorgan.com
> To: accessd at databaseadvisors.com
> Date: Tue, 16 Sep 2008 14:09:16 -0500
> Subject: [AccessD] Comparing Tables
>
> I have two tables. The first table contains a master list of wells. The second table contains a list of wells with automated test equipment. Only some of the wells are automated. I need to generate a list of all the wells with a flag field with a value of "A" if the well is automated and a value of "M" if it is not. I can probably do this with an unmatched query giving me a list of the manual wells and then another query to combine the second table and the results of this query but was looking for any ideas of a better way to do this.
>
>
> Chester Kaup
>
> Engineering Technician
>
> Kinder Morgan CO2 Company, LLP
>
> Office (432) 688-3797
>
> FAX (432) 688-3799
>
>
>
>
>
> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008



More information about the AccessD mailing list