Sergey, could not there be real trouble with using an alias of 'A' - 'J' as VFP uses those aliases for the first 10 open work areas? I know that you advised against the use of a single character alias (which I totally agree with) but have seen others use something like 'A'. Seems like they are asking for trouble with that approach.
>Hi David,
>
>There're a few reasons to use a table alias in a query. It's required if you use the same table more than once in a query. It could be a correlated subquery (like below) or a query that uses self-join on a table. You don't have to but may use an alias in multi-table query or/and query with long table names so query will be shorter and more readable. The key is to use short but easy recognizable aliases, not a, b, c, e.t.c.
>
>You can use < pre > and < /pre > tags (w/o spaces) to preseve code formatting. You should be able to see it if you've auto-quote turned on and hit reply on my message.
>
>>Hi Sergey,
>>
>>One question about the solution you posted; I had not used an alias in a select comand before. Is there a benefit for using aliases (ie. ST1) in Select comands, or was this for clarification?
>
>> SELECT st1.date, st1.name, ;
>> st1.status_id, st1.stats_id, st1.lots_id ;
>> FROM status st1 ;
>> WHERE st1.stats_id = event1val ;
>> AND NOT EXISTS (SELECT * FROM status st2 ;
>> WHERE st1.lots_id = st2.lots_id ;
>> AND st2.stats_id = event2val)
>
>>
>>Also (way off topic), how do you get your code to show with a different background color when posting to the thread?
>>
>>Thanks again Sergey.
>>
>>David