>Thanks for your replies Cetin :)
>
>I was referring to the functions fbtos() and the function that
>would have used the return string below:
> RETURN "'" + TRANSFORM(dtoc(m.tdDate,1), "@R 9999/99/99")
>
>Both returns string value representing dates as : '9999/99/99'
>
>However i've found out the culprit. Firebird do accept date as '01/01/2005',
>but i've overlook other possible causes for the error. I've discovered through
>trial-and-error that the cause of the error is that firebird gets confused
>when the field name is date.
> ?sqlexec(nHandle,"insert into table1 (date) values ('01/01/2005')")
> returns -1
>but
> ?sqlexec(nHandle,"insert into table1 (tdate) values ('01/01/2005')")
>returns 1
>who would have thought? it's quite queer for firebird to get confused with
>such an often-used field. I've just tried SQL Server 2005 Express and all works just fine..
>
>Thanks again for your inputs
Everyone dealing with databases should have thought:) date is a reserved word and we never thought you were writing your actual code. In SQL server such keywords are supported via quoted identifiers and angle brackets. ie:
myDate = {^2005/1/1}
?sqlexec(nHandle,"insert into table1 ([date]) values (?m.myDate)")
Again and again I say do not send your dates as formatted strings. OK with 1/1/2005 FB accepts it and is no problem. But what if you send 1/2/2005? Is it Jan 2,2005 or Feb 1,2005? Depending on settings is not very good.
Cetin