Click to See Complete Forum and Search --> : SQL to retrieve only certain entries


jonah_taxt
October 28th, 2004, 02:40 PM
Hi everyone. I'm trying to obtain only certain rows from a table. I need to retrieve those rows given a certain date. The code follows

cmd.CommandText = "SELECT intIDStatusCot, intIDCotizacion_Control FROM COTIZACION_CONTROL WHERE (dtmFecha <= #01/10/2004# AND dtmFecha >= #30/10/2004#)"

When I run this query, I get everything, all the rows in the table. Is there something wrong?

Thanx for any replies :wave:

Vanaj
October 28th, 2004, 05:49 PM
I take it dtmFecha is a date field in your database..if it is try adding it to the select statement.cmd.CommandText = "SELECT dtmFecha, intIDStatusCot, intIDCotizacion_Control FROM COTIZACION_CONTROL WHERE (dtmFecha <= #01/10/2004# AND dtmFecha >= #30/10/2004#)"