|
 |
access_asp thread: A point in right direction Please
Message #1 by topwebdesigns@h... on Mon, 15 Jul 2002 09:57:48
|
|
First off I am building a .ASP auto accessories website.
I am trying to find out where to do reseasrch on building some type of
query or something that would take a customers request of there year
say "1996", and search through my table that has Start_Year Field
of "1992" and a End_Year Field of "1999". I know from some other languaes
that I have to ask if:
IF = OR > 1992 or = to OR < 1999 Then show Products
Now I know that I need to ask that question just not sure how to or where
to.
Any Help would Greatly be appreciated
Thanks Rob
Message #2 by "Darrell" <darrell@b...> on Mon, 15 Jul 2002 19:52:21
|
|
Hi Rob
I am not to sure if you want to return all applicable records between two
dates or simply for the one date but either is relatively simple using an
SQL query.
For results between two dates you could try this:
strSQL ="SELECT whatever FROM table WHERE DateField BETWEEN
#"&StartDate&"# AND #"&EndDate&"#;"
or for a specific date try this:
strSQL ="SELECT whatever FROM table WHERE DateField = #"&RequestedDate&"#;"
If you need more info on using SQL try w3schools.com or sqlcourse.com
HTH
Cheers
Darrell
> First off I am building a .ASP auto accessories website.
> I am trying to find out where to do reseasrch on building some type of
q> uery or something that would take a customers request of there year
s> ay "1996", and search through my table that has Start_Year Field
o> f "1992" and a End_Year Field of "1999". I know from some other
languaes
t> hat I have to ask if:
> IF = OR > 1992 or = to OR < 1999 Then show Products
> Now I know that I need to ask that question just not sure how to or
where
t> o.
> Any Help would Greatly be appreciated
T> hanks Rob
Message #3 by topwebdesigns@h... on Wed, 24 Jul 2002 21:35:25
|
|
I finally got around to trying this but it does not work for what i am
trying to do I need to check this number meets Between two fields .
Between works greats on one field.
> Hi Rob
> I am not to sure if you want to return all applicable records between
two
d> ates or simply for the one date but either is relatively simple using
an
S> QL query.
> For results between two dates you could try this:
> strSQL ="SELECT whatever FROM table WHERE DateField BETWEEN
#> "&StartDate&"# AND #"&EndDate&"#;"
> or for a specific date try this:
> strSQL ="SELECT whatever FROM table WHERE DateField =
#"&RequestedDate&"#;"
> If you need more info on using SQL try w3schools.com or sqlcourse.com
> HTH
C> heers
D> arrell
>
>> First off I am building a .ASP auto accessories website.
> > I am trying to find out where to do reseasrch on building some type
of
q> > uery or something that would take a customers request of there year
s> > ay "1996", and search through my table that has Start_Year Field
o> > f "1992" and a End_Year Field of "1999". I know from some other
l> anguaes
t> > hat I have to ask if:
> > IF = OR > 1992 or = to OR < 1999 Then show Products
> > Now I know that I need to ask that question just not sure how to or
w> here
t> > o.
> > Any Help would Greatly be appreciated
T> > hanks Rob
Message #4 by "Ken Schaefer" <ken@a...> on Thu, 25 Jul 2002 11:16:54 +1000
|
|
I don't remember the original post, but from the brief, mangled description
that's still at the bottom, I think you want something like:
<%
intSearchYear = 1996 ' or whatever year the customer wants to search
strSQL = _
"SELECT ...yada, yada, yada ..." & _
"FROM table1 " & _
"WHERE StartYear <= " & intSearchYear & " " & _
"AND EndYear >= " & intSearchYear
Response.Write(strSQL)
Response.End
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <topwebdesigns@h...>
To: "Access ASP" <access_asp@p...>
Sent: Wednesday, July 24, 2002 9:35 PM
Subject: [access_asp] Re: A point in right direction Please
: I finally got around to trying this but it does not work for what i am
: trying to do I need to check this number meets Between two fields .
: Between works greats on one field.
:
: > Hi Rob
:
: > I am not to sure if you want to return all applicable records between
: two
: d> ates or simply for the one date but either is relatively simple using
: an
: S> QL query.
:
: > For results between two dates you could try this:
:
: > strSQL ="SELECT whatever FROM table WHERE DateField BETWEEN
: #> "&StartDate&"# AND #"&EndDate&"#;"
:
: > or for a specific date try this:
:
: > strSQL ="SELECT whatever FROM table WHERE DateField
: #"&RequestedDate&"#;"
:
: > If you need more info on using SQL try w3schools.com or sqlcourse.com
:
: > HTH
: C> heers
: D> arrell
:
: >
: >> First off I am building a .ASP auto accessories website.
:
: > > I am trying to find out where to do reseasrch on building some type
: of
: q> > uery or something that would take a customers request of there year
: s> > ay "1996", and search through my table that has Start_Year Field
: o> > f "1992" and a End_Year Field of "1999". I know from some other
: l> anguaes
: t> > hat I have to ask if:
:
: > > IF = OR > 1992 or = to OR < 1999 Then show Products
:
: > > Now I know that I need to ask that question just not sure how to or
: w> here
: t> > o.
:
: > > Any Help would Greatly be appreciated
: T> > hanks Rob
Message #5 by topwebdesigns@h... on Thu, 25 Jul 2002 13:18:26
|
|
Thank you Ken quotes didn't work for me But you got me determinded to try
everyway and Bamm! got it working thanks a lot
|
|
 |