Howard Carr Guest
|
Posted: Thu Aug 12, 2004 4:26 pm Post subject: Please Help with this error |
|
|
Using D5 with SQL server 2000.
I have an application that uses an updatable query on an SQL 2000 server. I
get the data ok, but when I edit and then post the data, I get the error
'Syntax error converting datetime from character string'.
The SQL function is
CREATE FUNCTION EffluentDataTestByDate(@TestDate DATETIME)
RETURNS TABLE
AS RETURN
(
SELECT TestDate, Tester, AerationBasinTemp, AerationOutP, AerationOutNH3,
AerationOutN03,
......
.......
FROM PaperMillData.dbo.EffluentData
WHERE (CONVERT(VARCHAR(12),TestDate,111) =
CONVERT(VARCHAR(12),@TestDate,111))
)
The delphi ado query is:
SELECT * FROM EffluentDataTestByDate(:TestDate)
order by TestDate
The object is:
object aqEffluentData: TADOQuery
Connection = acSQL
CursorType = ctStatic
MarshalOptions = moMarshalModifiedOnly
Parameters = <
item
Name = 'TestDate'
DataType = ftDateTime
Size = -1
Value = Null
end>
SQL.Strings = (
'select * from EffluentDataTestByDate(:TestDate)'
'order by TestDate')
The error stems from ado.pas with the function call
recordset.update(EmptyParam,EmptyParam)
Thanks...
|
|