[AccessD] Data Type Mismatch

Gustav Brock Gustav at cactus.dk
Tue Jan 16 10:14:36 CST 2007


Hi Keith

Union queries have a bad habit of turning anything into strings.
If so, use your union query as source in a new select query where you force all the fields into the datatypes they were:

  SELECT
    CLng(FieldLong) AS lngFieldLong,
    CInt(FieldInteger) AS IntFieldInteger
  ... etc.
  FROM
    qdyYourUnionQuery

The adjust your report to use this query and its fieldnames.

/gustav

>>> Kwilliamson at RTKL.com 16-01-2007 16:43:57 >>>
Ack!  It is a Union Query that is the source for the report.  I can't
change that, as I can't bring that up in Design view...only SQL view.

Keith E. Williamson | Assist. Controller| kwilliamson at rtkl.com 

RTKL Associates Inc. | 901 South Bond Street | Baltimore, Maryland
21231-3305

410-537-6098 direct | 410-276-2136 fax | www.rtkl.com 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos
Sent: Tuesday, January 16, 2007 10:14 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Data Type Mismatch

Temporarily create a "Make Table Query" with the other query as input.
Create a temporary table and then run the query, open the result table
in design mode and you will see the data types.

GK

On 1/16/07, Keith Williamson <Kwilliamson at rtkl.com> wrote:
> Is there an easy way to determine exactly what data type is being
> returned by a query?  I have a report I am trying to run, with a
> "Docmd.openreport".....but I keep getting a data mismatch error.  For
> the life of me, I can't figure out why......and I've tried playing with
> the Where statement, to get it to give me the right data...to no avail.
> I figure, if I can definitively determine the data type, for my three
> criterias....I can format the Where statement properly.....and also
> figure out why the query is changing the data type.   Grrrrr!!
>
>
>
> Thanks,
>
>
>
> Keith E. Williamson | Assist. Controller| kwilliamson at rtkl.com 
>
> RTKL Associates Inc. | 901 South Bond Street | Baltimore, Maryland
> 21231-3305
>
> 410-537-6098 direct | 410-276-2136 fax | www.rtkl.com 
> <http://www.rtkl.com/>




More information about the AccessD mailing list