Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Reg: Converting string to SQL date

Hi,

How can i format a string date to SQL date. If i use the below code, its giving me error at the line personal_DOB=df.parse(DOB_Personal); that cannot convert util date to SQL date.

String DOB_Personal=record.getFieldValue(fields[2]).toString();

SimpleDateFormat df=new SimpleDateFormat("MM/dd/yyyy");

Date personal_DOB=null;

try {

personal_DOB=df.parse(DOB_Personal);

} catch (ParseException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

Former Member
Not what you were looking for? View more on this topic or Ask a question