Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Filter Recordset Based on Date Greater Than Another Date


Message #1 by "Eric Levine" <eric@d...> on Thu, 18 Apr 2002 12:14:22 -0400
Good afternoon,

Perhaps someone could help me.  I am needing to Filter a recordset based
on a date being greater than another date. 

For Example, Show only those customer records that have logged onto the
system after a given date.  

I am trying to use the Filter command but am receiving the following
error:

ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type, are
out of acceptable range, or are in conflict with one another. 

My ASP code is the following:

rsCustomers.Filter = "last_login >" & rsStats("date_traffic")

Both last_login and date_traffic are Date/Time Fields in an Access DB.

Could anyone offer me some assistance on the correct syntax?  Thanks
much.

Regards,
Eric


Message #2 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Thu, 18 Apr 2002 12:37:25 -0400
If you using access try this :

rsCustomers.Filter = "last_login > #" & rsStats("date_traffic") & "#"

or for other databases you should try :
rsCustomers.Filter = "last_login > '" & rsStats("date_traffic") & "'"

Oleg




-----Original Message-----
From: Eric Levine [mailto:eric@d...]
Sent: April 18, 2002 12:14 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Filter Recordset Based on Date Greater Than
Another Date


Good afternoon,

Perhaps someone could help me.  I am needing to Filter a recordset based
on a date being greater than another date.

For Example, Show only those customer records that have logged onto the
system after a given date.

I am trying to use the Filter command but am receiving the following
error:

ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type, are
out of acceptable range, or are in conflict with one another.

My ASP code is the following:

rsCustomers.Filter = "last_login >" & rsStats("date_traffic")

Both last_login and date_traffic are Date/Time Fields in an Access DB.

Could anyone offer me some assistance on the correct syntax?  Thanks
much.

Regards,
Eric




---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #3 by "Gerhard Wentink" <data@w...> on Thu, 18 Apr 2002 19:12:12 +0200
You have to surround a datetime variable with # if you use an Access
database.
On a SQL server you have to use '

rsCustomers.Filter = "last_login > #" & rsStats("date_traffic") & "#"

Regards

Gerhard Wentink



>-----Original Message-----
>From: Eric Levine [mailto:eric@d...] 
>Sent: Thursday, April 18, 2002 6:14 PM
>To: ASP Web HowTo
>Subject: [asp_web_howto] Filter Recordset Based on Date 
>Greater Than Another Date
>
>
>Good afternoon,
>
>Perhaps someone could help me.  I am needing to Filter a 
>recordset based
>on a date being greater than another date. 
>
>For Example, Show only those customer records that have logged onto the
>system after a given date.  
>
>I am trying to use the Filter command but am receiving the following
>error:
>
>ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type, are
>out of acceptable range, or are in conflict with one another. 
>
>My ASP code is the following:
>
>rsCustomers.Filter = "last_login >" & rsStats("date_traffic")
>
>Both last_login and date_traffic are Date/Time Fields in an Access DB.
>
>Could anyone offer me some assistance on the correct syntax?  Thanks
>much.
>
>Regards,
>Eric
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/the
programme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #4 by "Eric Levine" <eric@d...> on Thu, 18 Apr 2002 15:41:06 -0400
Gerhard and Oleg,

Thank you very much.  That did the trick.

Regards,
Eric

-----Original Message-----
From: Gerhard Wentink [mailto:data@w...] 
Sent: Thursday, April 18, 2002 1:12 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Filter Recordset Based on Date Greater Than
Another Date

You have to surround a datetime variable with # if you use an Access
database.
On a SQL server you have to use '

rsCustomers.Filter = "last_login > #" & rsStats("date_traffic") & "#"

Regards

Gerhard Wentink



>-----Original Message-----
>From: Eric Levine [mailto:eric@d...] 
>Sent: Thursday, April 18, 2002 6:14 PM
>To: ASP Web HowTo
>Subject: [asp_web_howto] Filter Recordset Based on Date 
>Greater Than Another Date
>
>
>Good afternoon,
>
>Perhaps someone could help me.  I am needing to Filter a 
>recordset based
>on a date being greater than another date. 
>
>For Example, Show only those customer records that have logged onto the
>system after a given date.  
>
>I am trying to use the Filter command but am receiving the following
>error:
>
>ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type, are
>out of acceptable range, or are in conflict with one another. 
>
>My ASP code is the following:
>
>rsCustomers.Filter = "last_login >" & rsStats("date_traffic")
>
>Both last_login and date_traffic are Date/Time Fields in an Access DB.
>
>Could anyone offer me some assistance on the correct syntax?  Thanks
>much.
>
>Regards,
>Eric
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/the
programme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



Message #5 by "Gavin Landon" <glandon@g...> on Thu, 18 Apr 2002 15:06:11 -0500
Sounds like your dates are stored as varchar instead of datetime.

convert(datetime, FieldName1) > convert(datetime, FieldName2)

"Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message
news:166624@a..._web_howto...
>
> If you using access try this :
>
> rsCustomers.Filter = "last_login > #" & rsStats("date_traffic") & "#"
>
> or for other databases you should try :
> rsCustomers.Filter = "last_login > '" & rsStats("date_traffic") & "'"
>
> Oleg
>
>
>
>
> -----Original Message-----
> From: Eric Levine [mailto:eric@d...]
> Sent: April 18, 2002 12:14 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] Filter Recordset Based on Date Greater Than
> Another Date
>
>
> Good afternoon,
>
> Perhaps someone could help me.  I am needing to Filter a recordset based
> on a date being greater than another date.
>
> For Example, Show only those customer records that have logged onto the
> system after a given date.
>
> I am trying to use the Filter command but am receiving the following
> error:
>
> ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type, are
> out of acceptable range, or are in conflict with one another.
>
> My ASP code is the following:
>
> rsCustomers.Filter = "last_login >" & rsStats("date_traffic")
>
> Both last_login and date_traffic are Date/Time Fields in an Access DB.
>
> Could anyone offer me some assistance on the correct syntax?  Thanks
> much.
>
> Regards,
> Eric
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
>
>



  Return to Index