General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>>I could have sworn I did this before. I must have my syntax wrong:
>>>
>>>SELECT * FROM Depts WHERE Div_Code IN (SELECT DISTINCT Div_Code FROM NewDivs) INTO CURSOR NewDepts
>>>
>>>TIA
>>
>>The code works fine for me. What is happening?
>
>VFP is complaining that I need to create NEWDIVS with SELECT...TO TABLE, whereas I am using SELECT...TO CURSOR.
>
>Oooohhh! I think I see what's happening! I created NewDivs with a SELECT statement (SELECT * FROM Divs WHERE Proj_No = "20524.00" INTO CURSOR NewDivs) - but instead of creating a new table, VFP did a USE AGAIN on the original table with a filter (baaad fox)! I'll need to alter my first select statement in such a way to prevent VFP from doing that.
>
>I seem to remember an article about this many, many moons ago.
>
>I'd like to do it without altering the structure of the cursor, since I'm ultimately gonna APPEND FROM it. Any suggestions?
You could add a NOFILTER, but I've heard that doesn't always work. You could also add a , .T. to your field list. It will create exp_nn which would make sure that you get your non-filtered table and the field would never be appended.
HTH
Previous
Next
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