General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi Sergey,
I removed the line "AND tableA.date = tableB.date" from the select statement and it ran it from the command window without errors and I checked to see if the name, type and width were the same and I found that the "Type" was changed from "date" to "Character". There are quite a few tables that are linked and data is inserted from one to another so what I have found is that the person who orginially wrote the code for this program had a field specficially for a date but he chose to designate the type of filed as a "Character" with a width of "10" instead of "Date" with the default width of "8". Is there a way that I can programatically change the type and width of my field (Set as type: "date")in the sql statement upon appending the records to match his?
Select tableA.field5 as fieldtotal FROM tableA INNER JOIN tableB ON tableA.fieldname = tableB.fieldname AND tableA.date = tableB.date INTO cursor crsTemp
>>Copy the select statement into the command window and try to run with one join condition at time.
>When I choose "suspend" the debugger breaks at the first line of the select statement.
>
>>Which command gives you this error?
>
>>Hi Sergey,
>>I am now getting an "Operator/Operand type mismatch" How do I determine which fields are causing this error? The fields are of the same name, type and width so could it be something else?
>>
>>>>Here's corrected code
>>
>>>>Select tableA.field5 as fieldtotal ;
>> FROM tableA ;
>> INNER JOIN tableB ON tableA.namefield = tableB.namefield ;
>> AND tableA.datefield = tableB.datefield
>> INTO cursor crsTemp
>>
>> SELECT mytable
>> append from ( dbf('crsTemp') )
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