Subject Re: Update syntax
From Tom <IHaveNoEmail@ddress>
Date Sat, 13 Feb 2021 09:08:10 -0500
Newsgroups dbase.getting-started
Attachment(s) Msgbox3.png

On 2/13/21 3:34 AM, Mervyn Bick wrote:
> On 2021/02/12 23:25, Tom wrote:
>
>>
>> RevisedCode and RevisedMsgbox attached.
>>
>> Pretty sure I tried that before posting. Further suggestions?
>
> My previous message was written just before bedtime.  It's a new day and
> I'm busy on the second cup of coffee so the old grey mater is churning
> away. :-)
>
> The error message is telling you that the value associated with one, or
> more, of the fields listed in the SQL statement doesn't match the data
> type of the field.
>
> localSQL, as used by dBASE with .dbf files, requires literal dates to be
> in American (mm/dd/yyyy) or German (dd.mm.yyyy) format irrespective of
> the date setting on the computer.  You obviously use the American
> setting as the outputs from DTOC() and DTTOC() are both in mm/dd/yyyy
> form.  A timestamp field will accept any of the following literal
> values. '02/12/2021 16:19:27', '02/12/2021 04:17:27PM','02/12/2021
> 04:17:27pm', '02/12/2021 04:17:27 PM' or '02/12/2021 04:17:27 pm'. In
> other words, the values for your date and timestamp filed look OK.
>
> As you have sorted out the two boolean values this leaves the DemoDataID
> field as the prime suspect.  If this is a character field you will need
> to wrap the value in quotes in your UPDATE statement.
>
> Mervyn.
>
>

You can proceed to more important things gentlemen. You have once again
hit the nail squarely on the head Mervyn. The quotes around DemoDataID
value were all that were necessary for writing the data (see Msgbox3
attached). It was really annoying to have the 'INSERT INTO' portion of
the code working and not be able to get the 'UPDATE SET' syntax correct.
Now, both work just fine.

As it turns out, my late night solution was not necessary.

Thank you all very much for your help from around the world.

Regards,

Tom