Re: Union Query Data type Question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 07/16/04


Date: Fri, 16 Jul 2004 17:55:57 -0400

Try using CDbl([RealAmt]) in your query rather than simply [RealAmt]

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"teddyb777" <teddyb777@discussions.microsoft.com> wrote in message
news:2B6D85B5-F451-472D-9EC5-B57E1F578F06@microsoft.com...
> I have four tables that have the same columns and data types (4 different
fiscal years data).  I have a union query that combines the information into
one table using UNION ALL.  Then I am querying the Combined table, but I am
having trouble because it says that my number fields are text.  I have a
field called RealAmt that is a Double Number data type in all four tables
that are unioned.  When I try to write criteria to query that combined field
(RealAmt >0 and <100) it turns it into (RealAmt >"0" and <"100") so my
results are incorrect.  Any help would be appreciated.


Relevant Pages

  • Re: reserved error -1524 access 2007
    ... OT and cod are the same type ... If OT is a query, ... difficult to trace what's going on without details of the field types. ... It might be that JET is getting the data types mixed up. ...
    (microsoft.public.access.queries)
  • Re: Query Too Complex
    ... what data types are in use at each level? ... > the grouping levels, however this is by no means ideal. ... > Do you know of anything I can do to make this report run with the number ... >> how to run the query. ...
    (microsoft.public.access.reports)
  • Re: Selecting records using criteria as arguments for a mathematical operation
    ... Show us your query and the data types of the fields involved. ... error message seems to indicate you're doing something that violates ... In the Totals row of the query builder, have you considered changing the Sales column from GroupBy to Sum? ...
    (comp.databases.ms-access)
  • Re: Two questions: Access and SQL Server/VBA
    ... I have code that loops through the field names on a query and returns ... How is the easiest way to get the data types from the SQL Server ... end database. ... correct data types lengths). ...
    (comp.databases.ms-access)
  • Re: Specified Cast is not Valid
    ... Actually the final query will have about 3 columns returned from the DB. ... >> I have a method that executes a SQL Server stored procedure returning the ... >> int from SQL server I need to find out why I am getting specified cast is ... >> data types vs the sql data types. ...
    (microsoft.public.dotnet.languages.csharp)