sdf145
asked on
problem with Filter property in ADO......?
hi
iwant to filter my data depend on date and cunsumerFamily in the following way:
for example month=2 AND cunsumerFamily=X
another example year=1985 AND cunsumerFamily=X
but i dont know how to write a sql statement for ADO filter property that contained both date and consumerFamily with conditions above.
any help will be appreciated
thanks bayat
vb6
ado datacontrol
access 2000 database
iwant to filter my data depend on date and cunsumerFamily in the following way:
for example month=2 AND cunsumerFamily=X
another example year=1985 AND cunsumerFamily=X
but i dont know how to write a sql statement for ADO filter property that contained both date and consumerFamily with conditions above.
any help will be appreciated
thanks bayat
vb6
ado datacontrol
access 2000 database
Hi sdf145,
----------
did you try
rst.Filter = "Month=2 And ConsumerFamily <> 'X'"
----------
bruintje
share what you know, learn what you don't
----------
did you try
rst.Filter = "Month=2 And ConsumerFamily <> 'X'"
----------
bruintje
share what you know, learn what you don't
ASKER
it is not answer i am looking for
date field in database is in this format YYYY/MM/DD
but im looking for YYYY or MM
date field in database is in this format YYYY/MM/DD
but im looking for YYYY or MM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
ASKER
thank u for ur attempt
u are perfect
u are perfect
glad your sorted and thanks
Actually specify this in your sql
e.g.
sSql = "SELECT * FROM Table Where Month=2 AND CunsumerFamily='X'"
then use this sql when u open the recordset
or use the recordset filter
rs.Find "Month=2 AND CunsumerFamily='X'"