Hi,
I 've got a problem with adding current date to the table. I tried to add the current date along with other 2 fields exist in my table. They are ID (Number)and Desc(Alpha).
The code i used is as follows:
Desc := Edit2.Text;
CDate := DateToStr( Date );
qry.Close;
qry.SQL.Clear;
qry.SQL.Add( 'INSERT INTO Table1 (ID, Cdate, Desc)' );
qry.SQL.Add( ' VALUES (' + Edit1.Text + ',' + QuotedStr(CDate)+ QuotedStr(Desc) + ')' );
qry.ExecSQL;
This code gives an error. Can any one tell me what i have done wrong?
Many Thanks for u r help in advance,
Sanjna...
I 've got a problem with adding current date to the table. I tried to add the current date along with other 2 fields exist in my table. They are ID (Number)and Desc(Alpha).
The code i used is as follows:
Desc := Edit2.Text;
CDate := DateToStr( Date );
qry.Close;
qry.SQL.Clear;
qry.SQL.Add( 'INSERT INTO Table1 (ID, Cdate, Desc)' );
qry.SQL.Add( ' VALUES (' + Edit1.Text + ',' + QuotedStr(CDate)+ QuotedStr(Desc) + ')' );
qry.ExecSQL;
This code gives an error. Can any one tell me what i have done wrong?
Many Thanks for u r help in advance,
Sanjna...