I need to compare a value from one table and return a result from another ie Decode

From: julianp (julianp.14shm4_at_nospam.MSAccessForum.com)
Date: 04/15/04


Date: Thu, 15 Apr 2004 02:53:21 -0500


I am trying to use the design view in Access XP to construct a query and
subsequently a report.
However I need to decode some values by comparing the coded results of
each column of the query with the code_decode table and then returning
a decoded value from this table.

At present I am trying to workout what I should be entering in the
criteria box in the query designer to produce the following:

where decode.code_ref=table1.fieldname and
decode.code_val=table1.fieldvalue then return the value contained in
decode.decode_val

Table name decode
code_ref correspondes to the field in the table that we are decoding
code_val is the value assigned to coded data
decode_val is the translation of the code_val into plain English

I am not very good at entering SQL code and the query is already very
long so the sql is complex. Thus I am trying to use the Access query
builder where possible.

Any suggestions very gratefully received

Access is actually connected to a MYSQL Database through ODBC.

Julian

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Relevant Pages

  • Re: Using Flattened table COSTLIER than using JOINS with the SETUP tables.
    ... tables and also attaching the Explain plan statements for the query ... Next Execution plan without PSOPRALIAS:- is 13135 ... DECODE (TRIM (c.jp_draft_to_status), ...
    (comp.databases.oracle.tools)
  • I need to compare a value from one table and return a result from another ie Decode
    ... I am trying to use the design view in Access XP to construct a query and ... each column of the query with the code_decode table and then returning ... Table name decode ...
    (microsoft.public.access.gettingstarted)
  • Re: How to rewrite the query using with Clause
    ... What leads you to believe the performance of the current query is ... If you know enough to ask about the WITH clause you know enough to ... DECODE ... Give it a whirl first. ...
    (comp.databases.oracle.server)
  • Re: Query Assistance...
    ... I think john is saying that if the single letter code is 'u' then ... Code Status (aka "Text Decode Value") ... need to bring in this new table in the query along with your other ... two tables on the single-letter code fields, ...
    (microsoft.public.access.gettingstarted)
  • Re: Reports 2.5
    ... >> I have a query. ... I have a field on a summary report which is ... New, Aft etc. ... > One way is with DECODE. ...
    (comp.databases.oracle.tools)