Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL suggestions needed
Message
 
 
To
14/02/2000 14:16:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00331812
Message ID:
00331855
Views:
18
Hi Diane,

Thanks for your reply.

I know, that if my SQL returns 0 records, it produces an empty cursor (table in my case). But I want to have at least one record per town, which has no transactions for this time period. The SQL I showed was from ViewSQL table (we log SQL before execute), but it was constructed using selectcmd1, selectcmd2, etc., there each part is like FROM clause, where clause, etc. Where expression was constructed by form, which allows me to specify criteria. The obvious suggestion in my situation is devide this SQL into 2 pieces. Unfortunately, I can not do it this way, I need to do it in one SQL, otherwise I need to redesign several applications...


>I'm a novice in FoxPro and I don't know if I can help you. I'm working with an existing application which use SQL and work fine. So I'm learning by looking at their coding.
>
>Now I notice that when we have a select statement that find nothing it always return an empty cursor, the cursor include the definition of all the selected fields but it is empty.
>
>AS for your select statement itself, I would try using a left join on the Towns instead of a right join or use the Towns table without any join, and, instead put the joining condition in the where clause (where SiteMstr.Town=Towns.Town ).
>
>Good luck
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform