General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Thanks you all for all your suggestions. I'm still new in VFP (I'm using VFP 6). I'm still learning. In my code I left something out. It should have been :
SELECT tempcur.clerk, COUNT(*);
FROM tempcur;
GROUP BY clerk;
INTO DBF output\entries
My code is running alright now. Thanks again. You guys are great!!!!
Cheers, Richard.
PS. And thanks a lot Cetin for pointing out that bit about GROUP BY and ORDER BY. It really made things easier for me.
>>
>>>Hi guys,
>>>Can you use SELECT SQL statement on cursors? I have a cursor called tempcur and I had this satement :
>>>
>>>SELECT tempcur.clerk, tempcur.rates;
>>> FROM tempcur;
>>> GROUP BY clerk;
>>> ORDER BY clerk;
>>> INTO DBF output/entries
>>>
>>>
>>>I get an error message "Invalid path or file name" when I run the form. What's wron with this? I would be glad of any help from you guys.
>>
>>Others have posted answers to this. I just have one question about the use of GROUP BY in your statement. Why are you using it?
>>
>>As Cetin posted, GROUP BY will implicitly do an ORDER BY. It needs to so it can roll up all the information based on clerk. However, because you don't have an aggregate function, it may mess up your results. If you have one entry per clerk, then the GROUP BY doesn't do anything for you except add extra processing time. If you have multiple entries per clerk, then you will get the rate for that clerk that is located last physically in the table (i.e. the rate record with the highest record number). You may or may not want that.
>
>How ignorant I can be :) Originally Renoir had the correct answer I think. His problem seems to stem from the fact that folder doesn't exist (my eyes simply ignored the message and dominated on title). Next ignorance there was no aggregate function there :)
>Cetin
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only