The Error ORA-01830: date format picture ends before converting entire input string
Today, I find a error in my project, that display "ORA-01830: date format picture ends before converting entire input string "
Reason: My operation is Windows XP Enu, but others are Windows XP CH. In my operation, the default datetime format is 'dd/mm/yyyy'.
The follow sql string
string DateTimeStr = DataTime.Now.ToShortDateString();
"select * from a where time<to_date('"+DateTimeStr+"','yyyy-mm-dd')"
when I excute the sql string, The ORA-01830 error will be occure,
to fix the prolem, you should be replace the ToShortDateString() method by ToString('yyyy-mm-dd')
and other soulations are finding .
Thanks, Good Luck!
Reason: My operation is Windows XP Enu, but others are Windows XP CH. In my operation, the default datetime format is 'dd/mm/yyyy'.
The follow sql string
string DateTimeStr = DataTime.Now.ToShortDateString();
"select * from a where time<to_date('"+DateTimeStr+"','yyyy-mm-dd')"
when I excute the sql string, The ORA-01830 error will be occure,
to fix the prolem, you should be replace the ToShortDateString() method by ToString('yyyy-mm-dd')
and other soulations are finding .
Thanks, Good Luck!
浙公网安备 33010602011771号