My problem is the last bit of coding below, the like statement does not
work. what I have is a product options field and in it is stored characters
i.e. "avcy" etc what the query does is that if I type in any single
character all the products that match the criteria should be displayed. So
if I typed in an "a" I should get 3 returns (see below) Fields could look
like this:
product.options:
bhw
djhsa
ha
da
so out of the 4 products I would get 3 returns
This is the coding that I am using:
sql = "SELECT Products.[pict category], Products.product_code,
Products.description, Products.price, [images_add]+[product_code]+'.gif' AS
images, '" & Request.QueryString("find") & "' AS byprodcat,
Products.options, Products.detailed_desc, Products.dont_engrave FROM
Products, Extras WHERE (((Products.price)<10) AND (('" &
Request.QueryString("find") & "')='1')) OR (((Products.price)>10 And
(Products.price)<20) AND (('" & Request.QueryString("find") & "')='2')) OR
(((Products.price)>20 And (Products.price)<30) AND (('" &
Request.QueryString("find") & "')='3')) OR (((Products.price)>30) AND (('" &
Request.QueryString("find") & "')='4')) OR (((Products.dont_engrave)='" &
Request.QueryString("find") & "')) OR (((Products.[pict category])='" &
Request.QueryString("find") & "')) OR (((Products.product_code)='" &
Request.QueryString("find") & "')) OR (((Products.options) Like '*' & '" &
Request.QueryString("find") & "' & '*')) ORDER BY Products.price "
This is what access would generate, and then I have to change the coding to
make it work (see above)
sql = "SELECT Products.[pict category], Products.product_code,
Products.description, Products.price, [images_add]+[product_code]+"".gif""
AS images, " & Request.QueryString("[find]") & " AS byprodcat,
Products.options, Products.detailed_desc, Products.dont_engrave FROM
Products, Extras WHERE (((Products.price)<10) AND ((" &
Request.QueryString("[find]") & ")=""1"")) OR (((Products.price)>10 And
(Products.price)<20) AND ((" & Request.QueryString("[find]") & ")=""2"")) OR
(((Products.price)>20 And (Products.price)<30) AND ((" &
Request.QueryString("[find]") & ")=""3"")) OR (((Products.price)>30) AND (("
& Request.QueryString("[find]") & ")=""4"")) OR (((Products.dont_engrave)="
& Request.QueryString("[find]") & ")) OR (((Products.[pict category])=" &
Request.QueryString("[find]") & ")) OR (((Products.product_code)=" &
Request.QueryString("[find]") & ")) OR (((Products.options) Like ""*"" & " &
Request.QueryString("[find]") & " & ""*"")) ORDER BY Products.price " 9 4480
I'm having trouble understanding Request.Querystring("find")
Is this a UDF? I think changing the call to Request.Querystring('find')
might help.
Bob Q
"Peter" <pe******@hotmail.com> wrote in
news:bp*********@titan.btinternet.com: My problem is the last bit of coding below, the like statement does not work. what I have is a product options field and in it is stored characters i.e. "avcy" etc what the query does is that if I type in any single character all the products that match the criteria should be displayed. So if I typed in an "a" I should get 3 returns (see below) Fields could look like this:
product.options: bhw djhsa ha da
so out of the 4 products I would get 3 returns
This is the coding that I am using:
sql = "SELECT Products.[pict category], Products.product_code, Products.description, Products.price, [images_add]+[product_code]+'.gif' AS images, '" & Request.QueryString("find") & "' AS byprodcat, Products.options, Products.detailed_desc, Products.dont_engrave FROM Products, Extras WHERE (((Products.price)<10) AND (('" & Request.QueryString("find") & "')='1')) OR (((Products.price)>10 And (Products.price)<20) AND (('" & Request.QueryString("find") & "')='2')) OR (((Products.price)>20 And (Products.price)<30) AND (('" & Request.QueryString("find") & "')='3')) OR (((Products.price)>30) AND (('" & Request.QueryString("find") & "')='4')) OR (((Products.dont_engrave)='" & Request.QueryString("find") & "')) OR (((Products.[pict category])='" & Request.QueryString("find") & "')) OR (((Products.product_code)='" & Request.QueryString("find") & "')) OR (((Products.options) Like '*' & '" & Request.QueryString("find") & "' & '*')) ORDER BY Products.price "
This is what access would generate, and then I have to change the coding to make it work (see above)
sql = "SELECT Products.[pict category], Products.product_code, Products.description, Products.price, [images_add]+[product_code]+"".gif"" AS images, " & Request.QueryString("[find]") & " AS byprodcat, Products.options, Products.detailed_desc, Products.dont_engrave FROM Products, Extras WHERE (((Products.price)<10) AND ((" & Request.QueryString("[find]") & ")=""1"")) OR (((Products.price)>10 And (Products.price)<20) AND ((" & Request.QueryString("[find]") & ")=""2"")) OR (((Products.price)>20 And (Products.price)<30) AND ((" & Request.QueryString("[find]") & ")=""3"")) OR (((Products.price)>30) AND ((" & Request.QueryString("[find]") & ")=""4"")) OR (((Products.dont_engrave)=" & Request.QueryString("[find]") & ")) OR (((Products.[pict category])=" & Request.QueryString("[find]") & ")) OR (((Products.product_code)=" & Request.QueryString("[find]") & ")) OR (((Products.options) Like ""*"" & " & Request.QueryString("[find]") & " & ""*"")) ORDER BY Products.price "
Hi Bob
The problem in changing the cell from a like, is that I need to search that
cell because the character I am looking for could be anywhere in that cell
i.e.
I want to find a "a" characters is a cell "kfjnbateq"
a like command would find that
Peter
"Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message
news:26******************************@news.teranew s.com... I'm having trouble understanding Request.Querystring("find") Is this a UDF? I think changing the call to Request.Querystring('find') might help.
Bob Q
"Peter" <pe******@hotmail.com> wrote in news:bp*********@titan.btinternet.com:
My problem is the last bit of coding below, the like statement does not work. what I have is a product options field and in it is stored characters i.e. "avcy" etc what the query does is that if I type in any single character all the products that match the criteria should be displayed. So if I typed in an "a" I should get 3 returns (see below) Fields could look like this:
product.options: bhw djhsa ha da
so out of the 4 products I would get 3 returns
This is the coding that I am using:
sql = "SELECT Products.[pict category], Products.product_code, Products.description, Products.price, [images_add]+[product_code]+'.gif' AS images, '" & Request.QueryString("find") & "' AS byprodcat, Products.options, Products.detailed_desc, Products.dont_engrave FROM Products, Extras WHERE (((Products.price)<10) AND (('" & Request.QueryString("find") & "')='1')) OR (((Products.price)>10 And (Products.price)<20) AND (('" & Request.QueryString("find") & "')='2')) OR (((Products.price)>20 And (Products.price)<30) AND (('" & Request.QueryString("find") & "')='3')) OR (((Products.price)>30) AND (('" & Request.QueryString("find") & "')='4')) OR (((Products.dont_engrave)='" & Request.QueryString("find") & "')) OR (((Products.[pict category])='" & Request.QueryString("find") & "')) OR (((Products.product_code)='" & Request.QueryString("find") & "')) OR (((Products.options) Like '*' & '" & Request.QueryString("find") & "' & '*')) ORDER BY Products.price "
This is what access would generate, and then I have to change the coding to make it work (see above)
sql = "SELECT Products.[pict category], Products.product_code, Products.description, Products.price, [images_add]+[product_code]+"".gif"" AS images, " & Request.QueryString("[find]") & " AS byprodcat, Products.options, Products.detailed_desc, Products.dont_engrave FROM Products, Extras WHERE (((Products.price)<10) AND ((" & Request.QueryString("[find]") & ")=""1"")) OR (((Products.price)>10 And (Products.price)<20) AND ((" & Request.QueryString("[find]") & ")=""2"")) OR (((Products.price)>20 And (Products.price)<30) AND ((" & Request.QueryString("[find]") & ")=""3"")) OR (((Products.price)>30) AND ((" & Request.QueryString("[find]") & ")=""4"")) OR (((Products.dont_engrave)=" & Request.QueryString("[find]") & ")) OR (((Products.[pict category])=" & Request.QueryString("[find]") & ")) OR (((Products.product_code)=" & Request.QueryString("[find]") & ")) OR (((Products.options) Like ""*"" & " & Request.QueryString("[find]") & " & ""*"")) ORDER BY Products.price "
"Peter" <pe******@hotmail.com> wrote in
news:bp**********@titan.btinternet.com: Hi Bob The problem in changing the cell from a like, is that I need to search that cell because the character I am looking for could be anywhere in that cell i.e.
I want to find a "a" characters is a cell "kfjnbateq" a like command would find that
Peter
I'm not saying not to use like, but to diagnose your problem, I have to
figure out what Request.querystring() is and does., and what "find" is
and does.
OR Products.options Like
""*"" & " & Request.QueryString("[find]") & " & ""*""))
Is not acceptable use of quotes
LIKE '*'" & request.querystring('find') & "'*'" might be, but it still
seems wrong to me. I need to know about Request.Querystring()
This
Bob "Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message news:26******************************@news.teranew s.com... I'm having trouble understanding Request.Querystring("find") Is this a UDF? I think changing the call to Request.Querystring('find') might help.
Bob Q
"Peter" <pe******@hotmail.com> wrote in news:bp*********@titan.btinternet.com:
> My problem is the last bit of coding below, the like statement > does not work. what I have is a product options field and in it is > stored characters i.e. "avcy" etc what the query does is that > if I type in any single character all the products that match the > criteria should be displayed. So if I typed in an "a" I should get > 3 returns (see below) Fields could look like this: > > product.options: > bhw > djhsa > ha > da > > so out of the 4 products I would get 3 returns > > This is the coding that I am using: > > sql = "SELECT Products.[pict category], Products.product_code, > Products.description, Products.price, > [images_add]+[product_code]+'.gif' AS images, '" & > Request.QueryString("find") & "' AS byprodcat, Products.options, > Products.detailed_desc, Products.dont_engrave FROM Products, > Extras WHERE (((Products.price)<10) AND (('" & > Request.QueryString("find") & "')='1')) OR (((Products.price)>10 > And (Products.price)<20) AND (('" & Request.QueryString("find") & > "')='2')) OR (((Products.price)>20 And (Products.price)<30) AND > (('" & Request.QueryString("find") & "')='3')) OR > (((Products.price)>30) AND (('" & Request.QueryString("find") & > "')='4')) OR (((Products.dont_engrave)='" & > Request.QueryString("find") & "')) OR (((Products.[pict > category])='" & Request.QueryString("find") & "')) OR > (((Products.product_code)='" & Request.QueryString("find") & "')) > OR (((Products.options) Like '*' & '" & Request.QueryString("find") > & "' & '*')) ORDER BY Products.price " > > > This is what access would generate, and then I have to change the > coding to make it work (see above) > > sql = "SELECT Products.[pict category], Products.product_code, > Products.description, Products.price, > [images_add]+[product_code]+"".gif"" AS images, " & > Request.QueryString("[find]") & " AS byprodcat, Products.options, > Products.detailed_desc, Products.dont_engrave FROM Products, > Extras WHERE (((Products.price)<10) AND ((" & > Request.QueryString("[find]") & ")=""1"")) OR (((Products.price)>10 > And (Products.price)<20) AND ((" & Request.QueryString("[find]") & > ")=""2"")) OR (((Products.price)>20 And (Products.price)<30) AND > ((" & Request.QueryString("[find]") & ")=""3"")) OR > (((Products.price)>30) AND ((" & Request.QueryString("[find]") & > ")=""4"")) OR (((Products.dont_engrave)=" & > Request.QueryString("[find]") & ")) OR (((Products.[pict > category])=" & Request.QueryString("[find]") & ")) OR > (((Products.product_code)=" & Request.QueryString("[find]") & ")) > OR (((Products.options) Like ""*"" & " & > Request.QueryString("[find]") & " & ""*"")) ORDER BY > Products.price " > > > >
Bob
The whole thing seams so strange at the very bottom of this message is the
code that Access generates, them to make is work on the server I have to
mess around by putting in single quotes and string out square brackets. If
I take out the kind statement it works fine.
All I want to do is to get a wide card statement i.e. find a single
character in a string
Bob is there anything I can send you to help me solve the problem
Peter
"Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message
news:ce******************************@news.teranew s.com... "Peter" <pe******@hotmail.com> wrote in news:bp**********@titan.btinternet.com:
Hi Bob The problem in changing the cell from a like, is that I need to search that cell because the character I am looking for could be anywhere in that cell i.e.
I want to find a "a" characters is a cell "kfjnbateq" a like command would find that
Peter
I'm not saying not to use like, but to diagnose your problem, I have to figure out what Request.querystring() is and does., and what "find" is and does.
OR Products.options Like ""*"" & " & Request.QueryString("[find]") & " & ""*"")) Is not acceptable use of quotes LIKE '*'" & request.querystring('find') & "'*'" might be, but it still seems wrong to me. I need to know about Request.Querystring()
This Bob
"Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message news:26******************************@news.teranew s.com... I'm having trouble understanding Request.Querystring("find") Is this a UDF? I think changing the call to Request.Querystring('find') might help.
Bob Q
"Peter" <pe******@hotmail.com> wrote in news:bp*********@titan.btinternet.com:
> My problem is the last bit of coding below, the like statement > does not work. what I have is a product options field and in it is > stored characters i.e. "avcy" etc what the query does is that > if I type in any single character all the products that match the > criteria should be displayed. So if I typed in an "a" I should get > 3 returns (see below) Fields could look like this: > > product.options: > bhw > djhsa > ha > da > > so out of the 4 products I would get 3 returns > > This is the coding that I am using: > > sql = "SELECT Products.[pict category], Products.product_code, > Products.description, Products.price, > [images_add]+[product_code]+'.gif' AS images, '" & > Request.QueryString("find") & "' AS byprodcat, Products.options, > Products.detailed_desc, Products.dont_engrave FROM Products, > Extras WHERE (((Products.price)<10) AND (('" & > Request.QueryString("find") & "')='1')) OR (((Products.price)>10 > And (Products.price)<20) AND (('" & Request.QueryString("find") & > "')='2')) OR (((Products.price)>20 And (Products.price)<30) AND > (('" & Request.QueryString("find") & "')='3')) OR > (((Products.price)>30) AND (('" & Request.QueryString("find") & > "')='4')) OR (((Products.dont_engrave)='" & > Request.QueryString("find") & "')) OR (((Products.[pict > category])='" & Request.QueryString("find") & "')) OR > (((Products.product_code)='" & Request.QueryString("find") & "')) > OR (((Products.options) Like '*' & '" & Request.QueryString("find") > & "' & '*')) ORDER BY Products.price " > > > This is what access would generate, and then I have to change the > coding to make it work (see above) > > sql = "SELECT Products.[pict category], Products.product_code, > Products.description, Products.price, > [images_add]+[product_code]+"".gif"" AS images, " & > Request.QueryString("[find]") & " AS byprodcat, Products.options, > Products.detailed_desc, Products.dont_engrave FROM Products, > Extras WHERE (((Products.price)<10) AND ((" & > Request.QueryString("[find]") & ")=""1"")) OR (((Products.price)>10 > And (Products.price)<20) AND ((" & Request.QueryString("[find]") & > ")=""2"")) OR (((Products.price)>20 And (Products.price)<30) AND > ((" & Request.QueryString("[find]") & ")=""3"")) OR > (((Products.price)>30) AND ((" & Request.QueryString("[find]") & > ")=""4"")) OR (((Products.dont_engrave)=" & > Request.QueryString("[find]") & ")) OR (((Products.[pict > category])=" & Request.QueryString("[find]") & ")) OR > (((Products.product_code)=" & Request.QueryString("[find]") & ")) > OR (((Products.options) Like ""*"" & " & > Request.QueryString("[find]") & " & ""*"")) ORDER BY > Products.price " > > > >
"Peter" <pe******@hotmail.com> wrote in
news:bp**********@hercules.btinternet.com: Bob Bob is there anything I can send you to help me solve the problem
Yes there is. It's an explanation of Request.Querystring. Whyat is
Request.Querystring?
Bob
Peter
"Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message news:ce******************************@news.teranew s.com... "Peter" <pe******@hotmail.com> wrote in news:bp**********@titan.btinternet.com:
> Hi Bob > The problem in changing the cell from a like, is that I need to > search that cell because the character I am looking for could be > anywhere in that cell i.e. > > I want to find a "a" characters is a cell "kfjnbateq" > a like command would find that > > Peter >
I'm not saying not to use like, but to diagnose your problem, I have to figure out what Request.querystring() is and does., and what "find" is and does.
OR Products.options Like ""*"" & " & Request.QueryString("[find]") & " & ""*"")) Is not acceptable use of quotes LIKE '*'" & request.querystring('find') & "'*'" might be, but it still seems wrong to me. I need to know about Request.Querystring()
This Bob
> > "Bob Quintal" <Rq******@pants.sympatico.ca> wrote in message > news:26******************************@news.teranew s.com... >> I'm having trouble understanding Request.Querystring("find") >> Is this a UDF? I think changing the call to >> Request.Querystring('find') might help. >> >> >> Bob Q >> >> >> "Peter" <pe******@hotmail.com> wrote in >> news:bp*********@titan.btinternet.com: >> >> > My problem is the last bit of coding below, the like statement >> > does not work. what I have is a product options field and in it >> > is stored characters i.e. "avcy" etc what the query does is >> > that if I type in any single character all the products that >> > match the criteria should be displayed. So if I typed in an "a" >> > I should get 3 returns (see below) Fields could look like this: >> > >> > product.options: >> > bhw >> > djhsa >> > ha >> > da >> > >> > so out of the 4 products I would get 3 returns >> > >> > This is the coding that I am using: >> > >> > sql = "SELECT Products.[pict category], Products.product_code, >> > Products.description, Products.price, >> > [images_add]+[product_code]+'.gif' AS images, '" & >> > Request.QueryString("find") & "' AS byprodcat, Products.options, >> > Products.detailed_desc, Products.dont_engrave FROM Products, >> > Extras WHERE (((Products.price)<10) AND (('" & >> > Request.QueryString("find") & "')='1')) OR (((Products.price)>10 >> > And (Products.price)<20) AND (('" & Request.QueryString("find") >> > & "')='2')) OR (((Products.price)>20 And (Products.price)<30) >> > AND (('" & Request.QueryString("find") & "')='3')) OR >> > (((Products.price)>30) AND (('" & Request.QueryString("find") & >> > "')='4')) OR (((Products.dont_engrave)='" & >> > Request.QueryString("find") & "')) OR (((Products.[pict >> > category])='" & Request.QueryString("find") & "')) OR >> > (((Products.product_code)='" & Request.QueryString("find") & >> > "')) OR (((Products.options) Like '*' & '" & >> > Request.QueryString("find") & "' & '*')) ORDER BY >> > Products.price " >> > >> > >> > This is what access would generate, and then I have to change >> > the coding to make it work (see above) >> > >> > sql = "SELECT Products.[pict category], >> > Products.product_code, >> > Products.description, Products.price, >> > [images_add]+[product_code]+"".gif"" AS images, " & >> > Request.QueryString("[find]") & " AS byprodcat, >> > Products.options, Products.detailed_desc, Products.dont_engrave >> > FROM Products, Extras WHERE (((Products.price)<10) AND ((" & >> > Request.QueryString("[find]") & ")=""1"")) OR >> > (((Products.price)>10 And (Products.price)<20) AND ((" & >> > Request.QueryString("[find]") & ")=""2"")) OR >> > (((Products.price)>20 And (Products.price)<30) AND ((" & >> > Request.QueryString("[find]") & ")=""3"")) OR >> > (((Products.price)>30) AND ((" & Request.QueryString("[find]") & >> > ")=""4"")) OR (((Products.dont_engrave)=" & >> > Request.QueryString("[find]") & ")) OR (((Products.[pict >> > category])=" & Request.QueryString("[find]") & ")) OR >> > (((Products.product_code)=" & Request.QueryString("[find]") & >> > ")) OR (((Products.options) Like ""*"" & " & >> > Request.QueryString("[find]") & " & ""*"")) ORDER BY >> > Products.price " >> > >> > >> > >> > >> > > >
On Mon, 24 Nov 2003 01:27:11 GMT in comp.databases.ms-access, Bob
Quintal <Rq******@pants.sympatico.ca> wrote: "Peter" <pe******@hotmail.com> wrote in news:bp**********@hercules.btinternet.com:
Bob
Bob is there anything I can send you to help me solve the problem
Yes there is. It's an explanation of Request.Querystring. Whyat is Request.Querystring?
ASP.
On the page www.mysite.com/mypage.asp?blah
would return "blah"
--
A)bort, R)etry, I)nfluence with large hammer.
On Sun, 23 Nov 2003 22:55:33 +0000 (UTC) in comp.databases.ms-access,
"Peter" <pe******@hotmail.com> wrote: Bob
The whole thing seams so strange at the very bottom of this message is the code that Access generates, them to make is work on the server I have to mess around by putting in single quotes and string out square brackets. If I take out the kind statement it works fine.
All I want to do is to get a wide card statement i.e. find a single character in a string
Try using "%" instead of "*".
--
A)bort, R)etry, I)nfluence with large hammer.
Trevor
IT WORKED
Thank you very much to you Trevor and Bob for helping me out Thanks
Peter
"Trevor Best" <bouncer@localhost> wrote in message
news:ip********************************@4ax.com... On Sun, 23 Nov 2003 22:55:33 +0000 (UTC) in comp.databases.ms-access, "Peter" <pe******@hotmail.com> wrote:
Bob
The whole thing seams so strange at the very bottom of this message is
thecode that Access generates, them to make is work on the server I have to mess around by putting in single quotes and string out square brackets.
IfI take out the kind statement it works fine.
All I want to do is to get a wide card statement i.e. find a single character in a string
Try using "%" instead of "*".
-- A)bort, R)etry, I)nfluence with large hammer.
Guys can I take this one step further, the like command below, can I make
that case sensitive ???
Like '%' & '" & Request.QueryString("find") & "' & '%')) ORDER BY
Products.price "
Peter
sql = "SELECT Products.[pict category], Products.product_code,
Products.description, Products.price, '" & Request.QueryString("find") & "'
AS byprodcat, Products.options, Products.detailed_desc,
Products.dont_engrave FROM Products WHERE (((Products.price)<10) AND (('"
& Request.QueryString("find") & "')='1')) OR (((Products.price)>10 And
(Products.price)<20) AND (('" & Request.QueryString("find") & "')='2')) OR
(((Products.price)>20 And (Products.price)<30) AND (('" &
Request.QueryString("find") & "')='3')) OR (((Products.price)>30) AND (('" &
Request.QueryString("find") & "')='4')) OR (((Products.dont_engrave)='" &
Request.QueryString("find") & "')) OR (((Products.[pict category])='" &
Request.QueryString("find") & "')) OR (((Products.product_code)='" &
Request.QueryString("find") & "')) OR (((Products.options) Like '%' & '" &
Request.QueryString("find") & "' & '%')) ORDER BY Products.price "
"Peter" <pe******@hotmail.com> wrote in message
news:bp**********@sparta.btinternet.com... Trevor
IT WORKED
Thank you very much to you Trevor and Bob for helping me out Thanks
Peter
"Trevor Best" <bouncer@localhost> wrote in message news:ip********************************@4ax.com... On Sun, 23 Nov 2003 22:55:33 +0000 (UTC) in comp.databases.ms-access, "Peter" <pe******@hotmail.com> wrote:
Bob
The whole thing seams so strange at the very bottom of this message is thecode that Access generates, them to make is work on the server I have
tomess around by putting in single quotes and string out square brackets. IfI take out the kind statement it works fine.
All I want to do is to get a wide card statement i.e. find a single character in a string
Try using "%" instead of "*".
-- A)bort, R)etry, I)nfluence with large hammer.
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
4 posts
views
Thread by Radioactive Man |
last post: by
|
2 posts
views
Thread by coryjflynn |
last post: by
|
2 posts
views
Thread by Big John |
last post: by
|
1 post
views
Thread by S. van Beek |
last post: by
|
3 posts
views
Thread by Derrick |
last post: by
|
1 post
views
Thread by Craig Kenisston |
last post: by
|
7 posts
views
Thread by Risen |
last post: by
|
25 posts
views
Thread by samjnaa |
last post: by
| | | | | | | | | | |