I'm using vb 6.0 and ms access 2003 on my project. . .im trying to filter my database using its field Release_Date, im trying to search those records with a perticular month and year. here is my initial code:
me.adodc1.recordsource = "Select * from table where Release_Date like '%" & me.DTPicker.month & "%' and Release_Date like '%" & me.DTPicker.year & "%' "
i make sure to it that the format of my field Release_Date and my DTPicker is both long date, i figured out however that although my DTPicker is in longdate, the value it returns is in number form. it works sometimes, but in the case of january and february, it returns the value 1 and 2, the problem is that the year 2010 contains the two numbers, so it display everything with the year 2010. Then i tried to use combo boxes, one that contains the months, and the other contains the year, and change my code to:
me.adodc1.recordsource = "Select * from table where Release_Date like '%" & me.Combo1.text & "%' and Release_Date like '%" & me.Combo2.text & "%' "
the problem with my new code is, i think, my data base only accepts numbers too, so it does not display anything using my new code. . .
can you guys help me with this one, how could i display the records with my chosen month and year. . .thanks a lot, i hope to hear something from you guys soon. . .thanks