bonjour,
je souhaite faire une recherche sur une base de donnée. Cette recherche consisterait à sélectionner les produits ayant un prix maximum de Y.
j'ai réussi à faire ce tri (voir code ci-dessous) mais il ne fonctionne que pour des nombre entier je n'ai pas réussi à le modifier pour qu'il puisse faire cette rechercher avec un nombre a virgule.
Je pense qu'il faut remplacer la virgyle par un point mais je n'y arrive pas.
pouvez vous m'aider svp. merci beaucoup et joyeuse paques.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 'on récupère si il y a une recherche recherche = Request.QueryString("recherche") req1= "SELECT * FROM Articles, NCategories WHERE Articles.code_cat=NCategories.code_cat " 'si recherche = oui if recherche <> "OK" then r_lib=request.cookies(cook)("r_lib") r_cat=request.cookies(cook)("r_cat") r_prix=request.cookies(cook)("r_prix") else r_lib=request.form("r_lib") r_cat=request.form("r_cat") r_prix=request.form("r_prix") if r_prix<>"" and (not isNumeric (r_prix)) then response.Redirect("erreur.asp?num=2d") end if response.cookies("DUT2007stage04_admin")("r_lib")=r_lib response.cookies("DUT2007stage04_admin")("r_cat")=r_cat response.cookies("DUT2007stage04_admin")("r_prix")=r_prix response.cookies("DUT2007stage04_admin").expires=#30/06/2007# end if req21=" " req22=" " req23=" " if (r_lib<>"")then req21= " AND (lib_art LIKE '%" & r_lib & "%' OR commentaire LIKE'%" & r_lib & "%') " end if if (r_cat<>"") then req22= " AND NCategories.lib_cat='" & r_cat & "' " end if if (r_prix<>"") then r_prix=cint(r_prix) req23= " AND prix<=" & r_prix & " " end if req2=req21 & req22 & req23
Partager