
30/01/2008, 09:05
|
| | Fecha de Ingreso: noviembre-2007
Mensajes: 471
Antigüedad: 17 años, 5 meses Puntos: 2 | |
Re: buscador mm nose si me explique bien en la busqueda tengo 3 opciones de precio
1)<15000
2)15000-25000
3)>25000
y por eso uso select case pero claro tengo q hacer 3 tipos de busqueda diferente y por eso quiero ponerle nombres difernte a la query para diferencias a la hora de que se ejecute en cada uno de los casos.
Query = "select * from anuncio WHERE "
If Not IsEmpty(tit) Then
Query = Query + "Pais like '%" & tit & "%' and "
End If
If Not IsEmpty(Pro) Then
Query = Query + "Provincia like '%" & Pro & "%' and "
End If
If Not IsEmpty(pob) Then
Query = Query + "Poblacion like '%" & pob & "%' and "
End If
If Not IsEmpty(tipt) Then
Query = Query + "Tipoterreno like '%" & tipt & "%' and "
End If
If Not IsEmpty(tipv) Then
Query = Query + "TipoVivienda like '%" & tipv & "%' and "
End If
If Not IsEmpty(sist) Then
Query = Query + "sistema like '%" & sist & "%' and "
End If
If Not IsEmpty(supe) Then
Query = Query + "Metros like '%" & supe & "%' and "
End If
If Not IsEmpty(rangos) Then
Query = Query + "Precio between 0 and 15000 and "
End If
Query = "select * from anuncio WHERE "
If Not IsEmpty(tit) Then
Query = Query + "Pais like '%" & tit & "%' and "
End If
If Not IsEmpty(Pro) Then
Query = Query + "Provincia like '%" & Pro & "%' and "
End If
If Not IsEmpty(pob) Then
Query = Query + "Poblacion like '%" & pob & "%' and "
End If
If Not IsEmpty(tipt) Then
Query = Query + "Tipoterreno like '%" & tipt & "%' and "
End If
If Not IsEmpty(tipv) Then
Query = Query + "TipoVivienda like '%" & tipv & "%' and "
End If
If Not IsEmpty(sist) Then
Query = Query + "sistema like '%" & sist & "%' and "
End If
If Not IsEmpty(supe) Then
Query = Query + "Metros like '%" & supe & "%' and "
End If
If Not IsEmpty(rangos) Then
Query = Query + "Precio between 15000 and 25000 and "
End If
Query = "select * from anuncio WHERE "
If Not IsEmpty(tit) Then
Query = Query + "Pais like '%" & tit & "%' and "
End If
If Not IsEmpty(Pro) Then
Query = Query + "Provincia like '%" & Pro & "%' and "
End If
If Not IsEmpty(pob) Then
Query = Query + "Poblacion like '%" & pob & "%' and "
End If
If Not IsEmpty(tipt) Then
Query = Query + "Tipoterreno like '%" & tipt & "%' and "
End If
If Not IsEmpty(tipv) Then
Query = Query + "TipoVivienda like '%" & tipv & "%' and "
End If
If Not IsEmpty(sist) Then
Query = Query + "sistema like '%" & sist & "%' and "
End If
If Not IsEmpty(supe) Then
Query = Query + "Metros like '%" & supe & "%' and "
End If
If Not IsEmpty(rangos) Then
Query = Query + "Precio >= 25000 and "
End If |