RGoldthorpe
Technical User
Hello
I am creating reports on my datbase but because uses want sooooo many reports I am creating views and forms so that the user selects the information they want the report based on I.E. rep name selected and the haulier check box is ticked would produce a report for all that particular reps hauliers. If just haulier is ticked then it would produce a big list of all the hauliers .Any way this works fine when they are created from just one table but when I want to combine three tables I am having difficulty it creates the view fine but then comes up witha syntax error when you try to close the view after modifing it even though you make no changes Also it only shows two of the tables in the view although all the joins are there under the join tab.
The code is as follows
What am I doing wrong or can this not be done??
OPEN DATABASE "data\data1.dbc"exclusive
CREATE SQL VIEW seasonalview as SELECT *;
FROM organisations LEFT OUTER JOIN contact_Details_table ON org_scontact = ctd_sorg ;
LEFT OUTER JOIN field_plot_seasonal ON ctd_sorg = fps_sorg ;
WHERE ((ALLTRIM(organisations.org_scontact) == ?organisation) OR (EMPTY(?organisation)=.T.));
AND ((organisations.org_srep == ?rep OR (EMPTY(?rep)=.T.)));
AND ((Contact_details_Table.ctd_saddress4 == ?regions OR (EMPTY(?regions)=.T.)));
AND ((field_plot_seasonal.fps_svariety == ?variety OR (EMPTY(?variety)=.T.)));
AND ((field_plot_seasonal.fps_season == ?season OR (EMPTY(?season)=.T.)))
Thanks in advance
Rach
I am creating reports on my datbase but because uses want sooooo many reports I am creating views and forms so that the user selects the information they want the report based on I.E. rep name selected and the haulier check box is ticked would produce a report for all that particular reps hauliers. If just haulier is ticked then it would produce a big list of all the hauliers .Any way this works fine when they are created from just one table but when I want to combine three tables I am having difficulty it creates the view fine but then comes up witha syntax error when you try to close the view after modifing it even though you make no changes Also it only shows two of the tables in the view although all the joins are there under the join tab.
The code is as follows
What am I doing wrong or can this not be done??
OPEN DATABASE "data\data1.dbc"exclusive
CREATE SQL VIEW seasonalview as SELECT *;
FROM organisations LEFT OUTER JOIN contact_Details_table ON org_scontact = ctd_sorg ;
LEFT OUTER JOIN field_plot_seasonal ON ctd_sorg = fps_sorg ;
WHERE ((ALLTRIM(organisations.org_scontact) == ?organisation) OR (EMPTY(?organisation)=.T.));
AND ((organisations.org_srep == ?rep OR (EMPTY(?rep)=.T.)));
AND ((Contact_details_Table.ctd_saddress4 == ?regions OR (EMPTY(?regions)=.T.)));
AND ((field_plot_seasonal.fps_svariety == ?variety OR (EMPTY(?variety)=.T.)));
AND ((field_plot_seasonal.fps_season == ?season OR (EMPTY(?season)=.T.)))
Thanks in advance
Rach