Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL suggestions needed
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL suggestions needed
Miscellaneous
Thread ID:
00331812
Message ID:
00331812
Views:
56
Hi everybody,

I'm trying to select something without luck. Let me describe the problem:

I have several relational tables, one of which contains information about transactions. My form allows me to specify different criteria, like geography, for example. Say, I select a town, for which I have no transactions in a particular time period. I want to have this record in returning result with NULL in all fields. How can I achieve this?

This is my SQL:
SELECT * FROM tranmstr left JOIN misclndr on tranmstr.tranid = misclndr.tranid inner JOIN propmstr on tranmstr.propid = propmstr.propid inner JOIN sitemstr on tranmstr.propid = sitemstr.propid left JOIN bldgmstr on tranmstr.propid = bldgmstr.propid <b>right join Towns on SiteMstr.Town=Towns.Town</b> where (prefcode = "P" and sitemstr.town="GOSN" and SOURCE="S") and between(tranmstr.extrYear+tranmstr.extrWeek ,oJC.LowWeek, oJC.HighWeek)  INTO TABLE &qry_arg3
The selected part doesn't work. VFP holds up. If I exclude right join Towns, I receive zero (0) records. How can I change this SQL? Is it possible in just one SQL?
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform