Expression in query

R

Radhika

The query expression I am trying to build involves two tables. The first is
called 'tbl_NewInfo' and involves a field called 'XRT' with options 'Yes' and
'No'. The second is called 'tbl_TEPRecords' and involves the fields called
'XRTEndDate' (short date input mask) and 'XRT' with the options '1-3months,
'3-6 months', '>6months'. I want the query expression to give me the value
entered in the field 'XRT' (tbl_TEPRecords) if the
'XRTEndDate'(tbl_TEPRecords) is blank, but 'XRT' (tbl_NewInfo) is selected as
'Yes'. How could I go about doing this?

Thankyou.
Radhika
 
K

KARL DEWEY

Your table 'tbl_NewInfo' has only one field (Yes/No) so how do you relate the
two tables?
 
R

Radhika

'tbl_NewInfo' actually has several fields. Both 'tbl_NewInfo' and
'tbl_TEPRecords' have a field called 'ID#' that are related. I only mentioned
the Yes/No field as it was the one I wanted to include in my expression.
 
K

KARL DEWEY

Try this --
SELECT tbl_NewInfo.XRT, tbl_NewInfo.[ID#], tbl_TEPRecords.XRTEndDate,
tbl_TEPRecords.XRT
FROM tbl_NewInfo INNER JOIN tbl_TEPRecords ON tbl_NewInfo.[ID#] =
tbl_TEPRecords.[ID#]
WHERE (((tbl_NewInfo.XRT)=True) AND ((tbl_TEPRecords.XRTEndDate) Is Null));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Last Visit information 7
IIf statement in update query 3
Expression in a query 1
Update query criteria 10
Autofill query 0
date diff expression in query 5
Update query 0
IIf statement and check boxes 4

Top