(I have searched this forum and found other answers to the error message i'm getting, but none of the other users' issues seem to be similar to mine)
I retrieve data from a text file that has date/time information in text form.
I use a query to grab the revelant data from the text field (right, left, mid, etc.) and then use FinalDate=DateSerial(yearcolumn, monthcolumn, datecolumn) and FinalTime=TimeSerial(hourcolumn, minutecolumn, secondcolumn) to get the Time.
Then I add the two together to get my FinalDateTime value in a proper "time" formatted column.
Now I need to select dates from this field that fall between a certain start date and certain end date. These values are stored in TempVars.
On either the FinalDate or FinalDateTime columns, i have tried Criteria = Between [TempVars]![StartDate] and [tempVars]![EndDate], but get that old nasty error "expression typed incorrectly etc."
I have added a comparison column and say "CheckMe: IIF ([FinalDate] > [tempVars]![StartDate] and [FinalDate] < [TempVars]![EndDate], "Yes", "No")
Then i try to filter THAT column on "Yes" to show me only those that fall in the range.
Without anything in the Critieria field, the data populates perfectly. All of the entries that should fall between the dates show Yes and the ones that do not, show No.
But the query WILL NOT accept anything in the Criteria column. In the expression, I have tried IIF (x, 0, 1) or IIF (x, 1, 0), i have tried IIF (x, true, false), even IIF (x, "Yes", ""). All of the equations work perfectly but the daggum query still will not filter.
I removed anything from the Critieria row but left the expression. Then i created a new query based on this one, trying to select only where CheckMe = "Yes." No luck. same message.
I gave up on the TempVars and tried putting the dates into a table, to be absolutely positive i was comparing date vs date. Even if I used [datetable]![StartDateTable] instead of [tempVars]![StartDate], same doggone thing. results are perfect, cannot filter on it.
"The expression is typed incorrectly, or it is too complex to be evaluated." etc.
How can Access put a result in a field perfectly, but not let me sort on that same field??
I'm going nuts! :banghead:
I retrieve data from a text file that has date/time information in text form.
I use a query to grab the revelant data from the text field (right, left, mid, etc.) and then use FinalDate=DateSerial(yearcolumn, monthcolumn, datecolumn) and FinalTime=TimeSerial(hourcolumn, minutecolumn, secondcolumn) to get the Time.
Then I add the two together to get my FinalDateTime value in a proper "time" formatted column.
Now I need to select dates from this field that fall between a certain start date and certain end date. These values are stored in TempVars.
On either the FinalDate or FinalDateTime columns, i have tried Criteria = Between [TempVars]![StartDate] and [tempVars]![EndDate], but get that old nasty error "expression typed incorrectly etc."
I have added a comparison column and say "CheckMe: IIF ([FinalDate] > [tempVars]![StartDate] and [FinalDate] < [TempVars]![EndDate], "Yes", "No")
Then i try to filter THAT column on "Yes" to show me only those that fall in the range.
Without anything in the Critieria field, the data populates perfectly. All of the entries that should fall between the dates show Yes and the ones that do not, show No.
But the query WILL NOT accept anything in the Criteria column. In the expression, I have tried IIF (x, 0, 1) or IIF (x, 1, 0), i have tried IIF (x, true, false), even IIF (x, "Yes", ""). All of the equations work perfectly but the daggum query still will not filter.
I removed anything from the Critieria row but left the expression. Then i created a new query based on this one, trying to select only where CheckMe = "Yes." No luck. same message.
I gave up on the TempVars and tried putting the dates into a table, to be absolutely positive i was comparing date vs date. Even if I used [datetable]![StartDateTable] instead of [tempVars]![StartDate], same doggone thing. results are perfect, cannot filter on it.
"The expression is typed incorrectly, or it is too complex to be evaluated." etc.
How can Access put a result in a field perfectly, but not let me sort on that same field??
I'm going nuts! :banghead: