Visual Basic - DUDA EN INSTRUCCION SQL PLEASE...URGENTE

Life is soft - evento anual de software empresarial
 
Vista:

DUDA EN INSTRUCCION SQL PLEASE...URGENTE

Publicado por SPOW (40 intervenciones) el 20/10/2004 19:22:47
Hola colega, me gustaria saber como puedo hacer para colocar el "order by cod_parroquia" en la siguiente instruccion SQL ya que lo he intentado de varias formas y no me ha funcionado ninguna... Agradezco de tu ayuda.

Cmd.CommandText = "Select distinct COD_PARROQUIA, NOMBRE_PARROQUIA from SOBRES_CON_GUARNICIONES Where COD_EST = " + CStr(TXTestado1.Text) + " And COD_MUNICIPIO = " + CStr(TXTmunicipio1.Text)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

COMILLAS ???

Publicado por Hely (126 intervenciones) el 20/10/2004 19:38:03
Cmd.CommandText = "Select distinct NOMBRE_PARROQUIA from SOBRES_CON_GUARNICIONES Where COD_EST = " + CStr(TXTestado1.Text) + " And COD_MUNICIPIO = " + CStr(TXTmunicipio1.Text) ORDER BY COD_PARROQUIA

El error no era donde va el ORDER BY
TODOS los Campos Texto se incluyen dentro de Comillas..... EJ:
"SELECT ALL FROM Tabla WHERE Ciudad='Duitama' AND Sexo=1"

Prometo no olvidarlo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:COMILLAS ???

Publicado por SPOW (40 intervenciones) el 20/10/2004 19:56:48
Si pero el asunto es que cuando pongo la instruccion asi, al pasar a la siguiente linea me dice "Se esperaba fin de la instruccion"..
Tengo lo siguiente:

Cmd.CommandText = "Select distinct COD_PARROQUIA, NOMBRE_PARROQUIA from SOBRES_CON_GUARNICIONES Where COD_EST = " + CStr(TXTestado1.Text) + " And COD_MUNICIPIO = " + CStr(TXTmunicipio1.Text) order by cod_parroquia asc
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Listo resolvi =)

Publicado por SPOW (40 intervenciones) el 20/10/2004 19:59:18
Era de la siguiente manera:

Cmd.CommandText = "Select distinct COD_PARROQUIA, NOMBRE_PARROQUIA from SOBRES_CON_GUARNICIONES Where COD_EST = " + CStr(TXTestado1.Text) + " And COD_MUNICIPIO = " + CStr(TXTmunicipio1.Text) + " order by cod_parroquia asc"

Gracias de todas formas colega
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar