Im trying to create a report that only includes records that was created between to Date Variables, dateTo and dateFrom.
There are three combo boxes used to get the values for the two dates. Here's the code
I didn't include the select case for the month(in string) to be converted into an integer (ex. if "Jan" nFromMonth=1"
dateFrom = CDate(nFromMonth & "/" & cmbFromDay & "/" & cmbFromYear) dateTo = CDate(nToMonth & "/" & cmbToDay & "/" & cmbToYear)
I've tested this and im confident that theres nothing wrong with this.
Now, I want to do something like this:
Select CCIF_No, Date_Recieved From serviceRS Where Date_Recieved >=dateFrom AND Date_Recieved <=dateTo
This is my actual code so far and it doesnt work:
SELECT CCIF_No, Date_Recieved, FROM serviceRS WHERE (Date_Recieved <= '"&dateFrom&"' AND Date_Recieved <= '"&dateTo&"')
I tried Playing with the quotation marks and &s and #s but still doesnt work, either i get a "Failed getting rowset(s) from current data source" or a "Data type mismatch". Please advice. Thanks!
and sorry if this has been already tackled but i have searched daniweb and other forum sites but didn't get any solution.
Edited 6 Years Ago by drewpee: n/a