Re: if table is null then incluse all record else only in table ...hel
- From: "Gary Walter" <gary@xxxxxxxxxxx>
- Date: Mon, 25 Dec 2006 17:21:16 -0600
"Gary Walter" wrote in error:
on further thought:
"Silvio"wrote:
In short, if tbl2 have some value in it, retrieve only the matching
records
in tbl1 otherwise, if tbl2 is empty then retrieve all the records from
tb1.
This is what I have done, but if I live the control empty from the form,
no
records are retrieved at all, ignoring the "is null". Please help. In
short,
if tbl2 have some value in it, retrieve only the matching records in tbl1
otherwise, if tbl2 is empty then retrieve all the records from tb1.
SELECT tblData.City
FROM tblData
WHERE (((tblData.City) In (SELECT city FROM tblRepCity) Or (tblData.City)
Is
Null));
untested:
SELECT
tbl1.City
FROM
tbl1
INNER JOIN
tbl2
ON
tbl1.City = tbl2.City
OR
DCount("*","tbl2") =0;
SELECT tblData.City
FROM tblData
WHERE
tblData.City In (SELECT city FROM tblRepCity)
Or
DCount("*","tblRepCity") = 0;
.
- Follow-Ups:
- References:
- Re: if table is null then incluse all record else only in table ...hel
- From: Gary Walter
- Re: if table is null then incluse all record else only in table ...hel
- Prev by Date: Re: if table is null then incluse all record else only in table ...hel
- Next by Date: Re: if table is null then incluse all record else only in table ..
- Previous by thread: Re: if table is null then incluse all record else only in table ...hel
- Next by thread: Re: if table is null then incluse all record else only in table ..
- Index(es):
Relevant Pages
|