If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Query Should run but Data Type Mismatch error
I have been developing access databases for over 5 years.
I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query that will run fine without any criteria but as soon as I add any criteria it gives a "Data type mismatch" error. As soon as I remove any criteria it runs perfectly. I know this query is based on another query but I have other processes based on this query with no issues. I tried saving this query and basing another query on this one and got the same error. I have tried passing back variables from functions and still get a "Data type mismatch" eg: the following will run okay with the field b_cg_1 calculating corectly as a boolean (-1,0) SELECT qry_010_project_calc_base_forcast.*, CBool(nz([repl_cg_1],21)20- [element_base_life]) AS b_cg_1 FROM qry_010_project_calc_base_forcast If I add the criteria below I get an error WHERE (CBool(nz([repl_cg_1],21)20-[element_base_life]))=True When I run the following type of thing I get an error (typing from memory) SELECT qry_010_project_calc_base_forcast.* FROM qry_010_project_calc_base_forcast WHERE repl_cg_1 is not null As an aside this is the database I could not set a breakpoint in VBA to debug and had to import the entire contents into a new database to eliminate this error and get breakpoints working again. I hope someone has struck this issue before and has a fix as I look like a bit of a noddy saying to my client that I believe I have discovered and Access error. TIA, Gavin. |
#2
|
|||
|
|||
Any chance the underlying database has one/more tables with a lookup data
type defined? This could be why the criterion entered doesn't match the data type of the underlying field. -- Good luck Jeff Boyce Access MVP |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2000/2002 - Proper Mail Merge steps for ODBC? | Tony_VBACoder | Mailmerge | 7 | September 2nd, 2004 09:21 PM |
data type mismatch in criteria expression when no criteria specified | JR | Running & Setting Up Queries | 1 | July 27th, 2004 03:47 AM |
Is there a way around a Type Mismatch Error? | Kristen | Running & Setting Up Queries | 4 | June 24th, 2004 01:11 AM |
Data type mismatch in criteria expression | Emma | Using Forms | 2 | June 24th, 2004 12:32 AM |