Skip to Content
0
Former Member
May 17, 2010 at 09:51 PM

What's this error?

26 Views

Hi:

I'm trying to convert a dateString to dateTimer because i have to do a search using SQL, and this is what i did

DateTime DateIn, DateFinal;

DateIn = Convert.ToDateTime(getStartDate);

DateFinal = Convert.ToDateTime(getFinalDate);

sql = "SELECT ORDR.DocEntry, ORDR.TaxDate, RDR1.LineNum, RDR1.ItemCode, RDR1.Dscription, RDR1.Quantity, RDR1.U_Descripcion, RDR1.U_Plazo_Entrega FROM ORDR INNER JOIN RDR1 ON ORDR.DocEntry = RDR1.DocEntry WHERE ORDR.TaxDate >='" + DateIn + "' AND ORDR.TaxDate <='" + DateFinal + "'";

rPedido.DoQuery(sql);

and throw this Exception, ERROR to convert string to DateTime... and i can't find the error.. the error is in the sql expression..