You don't mention what type of library you're using to connect to Sybase and this might conceivable make a difference (for instance if you're using a Prepared Statement type call it might work differently than a DbLib or CTLib call--I can't say for sure because it depends on how the particular library you're using would handle a datetime/parameter substitution). If you're using CTLib or DbLib, and no prepared statement, the following explanation should hold:
The general rule is that when your program is submitting a query to the DB, you are passing text to the server which is in the form of SQL commands--but it is text. Underneath any higher-level calls you or your colleagues have implemented, what's happening is that a command buffer is being stuffed with the text and then an execute command is passed to the database library to send the command buffer contents to the server. But, what gets sent is text. Therefore, to call a stored procedure which takes a datetime parameter from a program, you'd format the datetime value just as you would when you invoke the command from an interactive SQL session. E.g.:
create proc takeDateTime (@theTime datetime)
as
select @theTime
go
execute takeDateTime '2002.01.01'
go
So, your program needs to generate that string of characters and pass it to the SQL command buffer and then execute the command.
Depending upon what kind of format you have for the datetime parameter your program is trying to pass, you may need to do an internal conversion within the program to create an appropriate string representation of the datetime value.
HTH,
John J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net