|
-
May 17th, 2008, 03:38 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] DataEnvironment Filters
I believe I need to use the .Filters property of a data environment command, I need to return all records between two dates, what syntax should I use?
-
May 17th, 2008, 04:21 PM
#2
Hyperactive Member
Re: DataEnvironment Filters
-
May 17th, 2008, 05:03 PM
#3
Thread Starter
Frenzied Member
Re: DataEnvironment Filters
Nice
Using the Filter attribute e.g.
DataEnvironment1.rsRecordset.Filter ="blah"
This will return the recordset with only they applicable records that pass the filter, I need to filter between two dates, what syntax should I use, is it the same as SQL, because I didn't have much luck with that.
-
May 18th, 2008, 05:54 AM
#4
Re: DataEnvironment Filters
I would highly recommend SQL for this.
What SQL code did you try with which you did not have much luck?
What kind of database are you using?
-
May 18th, 2008, 11:35 AM
#5
Thread Starter
Frenzied Member
Re: DataEnvironment Filters
Let me explain, I am using the Date Environment to interface with an Access database for a college project.
I do not want to use SQL in that concept because my friends have easily used a filter to sort an existing recordset.
All I need to know is what syntax to use, to make sure the [date] field is between tomorrows date, and the date a year and a day down the line.
-
May 18th, 2008, 10:15 PM
#6
Re: DataEnvironment Filters
 Originally Posted by I_Love_My_Vans
Let me explain, I am using the Date Environment to interface with an Access database for a college project.
I do not want to use SQL in that concept because my friends have easily used a filter to sort an existing recordset.
All I need to know is what syntax to use, to make sure the [date] field is between tomorrows date, and the date a year and a day down the line.
The filter is based on the WHERE clause concept of SQL. You'll have to learn it one way or another.
As to your use of Filter, it's not very efficient. You end up loading first most of the records (if not all) of the table into memory before trimming it down. Bad habit to acquire.
Lastly, the data environment is not scalable and easily becomes a white elephant in terms of updatability and maintenance.
-
May 19th, 2008, 01:36 AM
#7
Re: DataEnvironment Filters
This is the syntax,
Code:
DataEnvironment1.rsCommand1.Filter = "startdate >= #10/1/2007# and startdate <= #10/10/2007#"
if you are going to use variables then you have to format the string properly,
Code:
DataEnvironment1.rsCommand1.Filter = "startdate >= #" & varStringdate1 & "# and startdate <= #" & varStringdate2 & "#"
-
May 23rd, 2008, 03:42 PM
#8
Thread Starter
Frenzied Member
-
May 25th, 2008, 08:40 PM
#9
Re: [RESOLVED] DataEnvironment Filters
Use of data environment is usually tied to the assumption that it's needed in order to use the data report. This is not so, you can use data reports bypassing design time set-up once you've learned SQL http://www.vbforums.com/showthread.php?t=433765
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|