Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VIEW DESIGNER parsing problem!
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
VIEW DESIGNER parsing problem!
Miscellaneous
Thread ID:
00120504
Message ID:
00120504
Views:
56
I had created a view using the view designer but couldn't persuade
it to form the syntax of the SQL statement the way I wanted it to be.
In order to solve this parsing problem in the view designer I had
to use CREATE VIEW command in the command window:
CREATE SQL VIEW lv_lt2000 AS SELECT Persinfo.proprty_id, Persinfo.batch, Persinfo.rpt,;
  Persinfo.appstatus, Persinfo.ssn, Persinfo.name, Persinfo.app_type,;
  Persinfo.hec, Persinfo.yoba, Persinfo.part, Persinfo.p1line2,;
  Persinfo.p2line2, Persinfo.totincome;
 FROM homested!persinfo;
 WHERE Persinfo.appstatus = "OK";
   AND (Persinfo.yoba BETWEEN 1 AND 1932 OR Persinfo.syob BETWEEN 1 AND 1932);
   AND ((Persinfo.part = 1 AND Persinfo.p1line2+Persinfo.p1line3 < 2000);
   OR (Persinfo.part = 2 AND Persinfo.p2line2+Persinfo.p2line3 < 2000));
 ORDER BY Persinfo.batch, Persinfo.rpt

Below is what the view builder displays if you look at the VIEW,
and STORES if you save the view, instead of just closing it:
SELECT Persinfo.proprty_id, Persinfo.batch, Persinfo.rpt,;
 Persinfo.appstatus, Persinfo.ssn, Persinfo.name, Persinfo.app_type,;
  Persinfo.hec, Persinfo.yoba, Persinfo.part, Persinfo.p1line2,;
  Persinfo.p2line2, Persinfo.totincome;
 FROM homested!persinfo;
 WHERE Persinfo.appstatus = "OK";
 AND Persinfo.yoba BETWEEN 1 AND 1932;
 OR (Persinfo.syob BETWEEN 1 AND 1932;   <--- notice the "("
 AND Persinfo.part = 1;
 AND Persinfo.p1line2+Persinfo.p1line3 < 2000);  <-- notice the ")"
 OR (Persinfo.part = 2;			<-- ditto
 AND Persinfo.p2line2+Persinfo.p2line3 < 2000);  <-- ditto
 ORDER BY Persinfo.batch, Persinfo.rpt
The view designer used standard boolean logic to parse the data in the
view setup form and gives a SQL select that is different from what was
intended. I couldn't trick the view designer into putting the "("
in front of the first AND and after the second "1932".

Can anyone show me a workaround using the view designer?

P.S. - Don't ask about the hardcoded dates!!!
Nebraska Dept of Revenue
Next
Reply
Map
View

Click here to load this message in the networking platform