Group:  Microsoft Excel ยป microsoft.public.excel.querydao
Thread: Strange DataType MisMatch

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Strange DataType MisMatch
"G" <Garret.Hurd[ at ]xicomtech.com> 03.03.2006 20:04:10
I have used Msquery to created *.dqy's to extract data from an MSAccess 2K
data source. Typically, I use the standard [paramName] in the criteria
window to name the parameters, but in this case I cannot. The square
brackets must contain nothing or a 'too few parameters' error will show.

Here is the SQL statement
DSN=MS Access
Database;DBQ=F:\quansTables2000.mdb;DefaultDir=F:\;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;
SELECT Count(*) AS 'Fails' FROM `F:\quansTables2000`.tblFinalTest
tblFinalTest WHERE (tblFinalTest.date Between ? And ?) AND
(tblFinalTest.technician=?) GROUP BY tblFinalTest.fail HAVING
(tblFinalTest.fail=1)

The query will run fine from MSquery, but the parameters are not named and
pop up with non-meaningful names like parameter 1, 2,...

When I trying to run the query from inside excel, its strange too. The
parameters box is 'greyed out' on the initial query screen, but then each
parameter box pops up individually with the option to get the information
from a particular cell. Anytime a cell is referenced in the paramater box, a
data type mismatch is displayed. Typically a query with parameters activates
the parameter button on the first form.

Any ideas on this stuff. Thanks in advance.





Re: Strange DataType MisMatch
"DM Unseen" <dm.unseen[ at ]gmail.com> 09.03.2006 08:42:56
Reading your query, you could start by using:

SELECT Count(*) AS Fails FROM `F:\quansTables2000`.tblFinalTest
tblFinalTest WHERE (tblFinalTest.date Between ? And ?) AND
(tblFinalTest.technician=?) AND (tblFinalTest.fail=1)

The group by/having is superfluous because you just select 1 group
(i.e. the group where tblFinalTest.fail=1)

For the rest everything looks OK

Dm Unseen

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net