Print Page | Close Window

rs filter

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21038
Printed Date: 28 March 2026 at 5:58pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: rs filter
Posted By: dfrancis
Subject: rs filter
Date Posted: 15 August 2006 at 1:40pm
Can anyone tell me why a specific string will work but a date() will not?
 
I have a simple "select" from a table

sql = "SELECT *, convert( varchar(20), started, 101 ) as started2 "&_
"FROM         live_visitor_stats "&_ 
"WHERE     (DATEPART(mm, started) = DATEPART(mm, { fn NOW() }))"&_
"ORDER BY started desc"
 
 
It works fine and gives me all records in the table for the current month.
 
I want to take those records and filter them for just today's date.

rs.filter = "started2 = 08/15/2006"
And this works fine...
 
BUT
 
When I try this

rs.filter = "started2 = "&Date()
It returns zero records. Can anyone tell me why?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net