Updating from a form:
(FP2003/SQL 2K SP3)

Have tried this many ways:

update SVC00200 set srvstat=::Status_set::,
Arrivdte='::ArrivedDate::',
ArrivTme=''1900-01-01'+' '+::ArriveTime::',
CompDte='::CompDate::',
CompTme='::CompTime::'
where callnbr='::Callnbr::'

update SVC00200 set srvstat=::Status_set::,
Arrivdte='::ArrivedDate::',
ArrivTme='::ArriveTime::',
CompDte='::CompDate::',
CompTme='::CompTime::'
where callnbr='::Callnbr::'

update SVC00200 set srvstat=::Status_set::,
Arrivdte='::ArrivedDate::',
ArrivTme=::ArriveTime::,
CompDte='::CompDate::',
CompTme='::CompTime::'
where callnbr='::Callnbr::'

ArrivDte and ArrivTme are datetime fields in SQL Server. This is for a
website doing remote updates to an application database so I cannot change
the field types. Don't ask me why they keep the date in one field and the
time in another. Anyway, I can update the date just fine, but get various
errors updateing the time from a form:

Syntax error converting datetime from character string
You should provide default values for all form fields that are used in the
query.

Depending on how I've got the above code written. The default for both
fields is 1900-01-01 00:00:00.000.

A straight update statement works fine:

update svc00200
set arrivtme='3:00 PM'
where callnbr='0000031083'

and updates the arrivtme to 1900-01-01 15:00:00.000


Any help is appreciated.

Re: Updating a datetime field in SQL Server by Jon

Jon
Fri Nov 12 07:13:27 CST 2004

Hi,
you can't sto
"Jeff Metcalf" <JeffMetcalf@discussions.microsoft.com> wrote in message
news:795B6BB4-90F0-4B04-B3DA-B3D1FF1806AE@microsoft.com...
> Updating from a form:
> (FP2003/SQL 2K SP3)
>
> Have tried this many ways:
>
> update SVC00200 set srvstat=::Status_set::,
> Arrivdte='::ArrivedDate::',
> ArrivTme=''1900-01-01'+' '+::ArriveTime::',
> CompDte='::CompDate::',
> CompTme='::CompTime::'
> where callnbr='::Callnbr::'
>
> update SVC00200 set srvstat=::Status_set::,
> Arrivdte='::ArrivedDate::',
> ArrivTme='::ArriveTime::',
> CompDte='::CompDate::',
> CompTme='::CompTime::'
> where callnbr='::Callnbr::'
>
> update SVC00200 set srvstat=::Status_set::,
> Arrivdte='::ArrivedDate::',
> ArrivTme=::ArriveTime::,
> CompDte='::CompDate::',
> CompTme='::CompTime::'
> where callnbr='::Callnbr::'
>
> ArrivDte and ArrivTme are datetime fields in SQL Server. This is for a
> website doing remote updates to an application database so I cannot change
> the field types. Don't ask me why they keep the date in one field and the
> time in another. Anyway, I can update the date just fine, but get various
> errors updateing the time from a form:
>
> Syntax error converting datetime from character string
> You should provide default values for all form fields that are used in the
> query.
>
> Depending on how I've got the above code written. The default for both
> fields is 1900-01-01 00:00:00.000.
>
> A straight update statement works fine:
>
> update svc00200
> set arrivtme='3:00 PM'
> where callnbr='0000031083'
>
> and updates the arrivtme to 1900-01-01 15:00:00.000
>
>
> Any help is appreciated.