dominicall
03-27-2003, 06:34 AM
Grrrrrrrr.........
Datebase = SQL
Date column formats = datetime
Anyone see this.... have a table containing availability dates for holiday boats - with weekly availability and am having a bit of trouble finding the problem...
Select string = "SELECT * FROM tbl_Prices WHERE WeekStart > " & DATE & " AND BoatID=" & BoatID & " ORDER BY WeekStart ASC;"That all works fine and selects the data...
Am then trying to filter the recordset so it displays prices by year using....'Now get the prices and filter by year
Dim NowYear, ThenYear
NowYear = DatePart("yyyy",DATE)
ThenYear = DatePart("yyyy",DateAdd("yyyy",2,DATE))
Dim strCriteria, intYear
For intYear = NowYear To ThenYear
strCriteria = "WeekStart = '*" & intYear & "*'"
rsGetPrices.Filter = strCriteria
But whenever it hits the filter it throws a type mismatch.... have tried various definitions of strCriteria - without success.
Am on point of using computer as a football - grrrr - LOL
dominicall
Datebase = SQL
Date column formats = datetime
Anyone see this.... have a table containing availability dates for holiday boats - with weekly availability and am having a bit of trouble finding the problem...
Select string = "SELECT * FROM tbl_Prices WHERE WeekStart > " & DATE & " AND BoatID=" & BoatID & " ORDER BY WeekStart ASC;"That all works fine and selects the data...
Am then trying to filter the recordset so it displays prices by year using....'Now get the prices and filter by year
Dim NowYear, ThenYear
NowYear = DatePart("yyyy",DATE)
ThenYear = DatePart("yyyy",DateAdd("yyyy",2,DATE))
Dim strCriteria, intYear
For intYear = NowYear To ThenYear
strCriteria = "WeekStart = '*" & intYear & "*'"
rsGetPrices.Filter = strCriteria
But whenever it hits the filter it throws a type mismatch.... have tried various definitions of strCriteria - without success.
Am on point of using computer as a football - grrrr - LOL
dominicall