Data Type Mismatch in criteria expression?? (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


patturkington -> Data Type Mismatch in criteria expression?? (6/18/2003 14:18:48)

I would appreciate any help with the following error message. I' m trying to use several fields to filter records in a database. I would like to include a date field to search by a specific date but everytime I include the date as a search field I get the following. I' m a novice sorry if this is trivia stuff!

Database Results Error
Description: Data type mismatch in criteria expression.
Number: -2147217913 (0x80040E07)
Source: Microsoft JET Database Engine




bobby -> RE: Data Type Mismatch in criteria expression?? (6/18/2003 14:40:12)

In your SQL query expression you' re probably missing the #' s

It should look something like:

" select * from Table where Date=#" & request.form(" date" ) & " # ;"

Dates need to be surrounded by #' s in order to be processed as date/time




patturkington -> RE: Data Type Mismatch in criteria expression?? (6/18/2003 17:45:50)

Thanks Bobby - I have tried that but am still getting the same error - I' m using the DRW, where do the # marks go in this custom query?

SELECT * FROM Results WHERE (Date = ' ::Date::' )

Thanks




Spooky -> RE: Data Type Mismatch in criteria expression?? (6/18/2003 19:29:27)

That query is ok as FP accepts both ' and #
However, " DATE" is a reserved word and shouldnt be used as a column name.
If you cant change it then, do :

SELECT * FROM Results WHERE ([Date] = ' ::Date::' )




patturkington -> RE: Data Type Mismatch in criteria expression?? (6/18/2003 20:14:07)

Thank you for your help - I' ve tried the above and even changed the name of my date column but still I' m getting the data mismatch error, the only time it doesn' t appear is when I take the date field off as a search field - but I do need to filter by date - any other ideas????




Spooky -> RE: Data Type Mismatch in criteria expression?? (6/18/2003 21:44:28)

Are you always passing a date? If its null, youll need to enter a default date at step 3 of the DRW or include a default date in the text box when the search page is first entered.




patturkington -> RE: Data Type Mismatch in criteria expression?? (6/19/2003 3:03:56)

I' ve just looked on the Frontpage site and their response is to change the data type for the column to text. This works fine but how do you sort the results in date order????




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875