Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Omitting A Clients

Status
Not open for further replies.

StacyStacy

Programmer
Apr 16, 2003
60
US
What is wrong with the following code?

I do not want to show any clients that have a termdate:
NOTE: the beginning date = m.begdate & the ending date = m.enddate



SELECT *;
FROM itatmp;
WHERE entertdt_a <= m.enddate;
AND (termdate <> m.begdate OR empty(termdate));
INTO table parttmp
 
By including the expression "termdate <> m.begdate" with an .OR. operator, it seems like you may have completely negated the effect you were after by including the "empty(termdate)" expression.

When you say
I do not want to show any clients that have a termdate:

it seems like omitting part of your filter condition will accomplish this for you:

SELECT *;
FROM itatmp;
WHERE entertdt_a <= m.enddate;
AND empty(termdate));
INTO table parttmp

Otherwise you may need to provide more info about the usual contents of the data fields, the values assigned to m.begdate and m.enddate, the results your current query returns, etc.
 
I am not sure, but maybe is this what you need?

SELECT *;
FROM itatmp;
WHERE BETWEEN(entertdt_a, m.begdate, m.enddate)=.T.;
HAVING termdate={};
INTO table parttmp

give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top