Forums Register Login

Convert DateTime Error

+Pie Number of slices to send: Send
Complete newbie to java

I am trying to do a convert from a parameter to a datetime stamp. Here is my code:
... bus_start_date between (CONVERT(DATETIME,\'args[3]\', 102)) and (CONVERT(DATETIME,\'args[4]\', 102))) ...
Exception in thread "main" java.sql.SQLException: Syntax error converting datetime from character string.

When I enter a hard coded sting instead of the parms it works ex('2008-01-02 00:00:00')

Can ANY one help please,

Thank you in advance
+Pie Number of slices to send: Send
It has nothing to do with Java. You have an SQL syntax error here. What database are you using? Whatever it may be, the arg is not translating into actual value here.

Sincerely
Your friends at www.javaadvice.com
+Pie Number of slices to send: Send
MSSQL Server

I cant seem to be able to get the syntax right. Can yu help
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1334 times.
Similar Threads
time conversion
Joda DateTime
problem while insert date data in mysql
unable to retrieve timestamp in my servlet
How to insert a data of datetype timestamp into Sqlserver2000
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:46:53.