Re: Use of having with additional select



On Wed, 23 Apr 2008 13:49:49 -0700 (PDT), Seguros Catatumbo wrote:


I can't test because I have no access to your tables and test data, but
try if the followiing does what you need:

Table CLPF08 sample data and relevant field information:

RAMO POLIZA CERVEH CODCOB MONTO1
31 6100265 2 1 20.15
31 6100265 2 2 30.10
31 6100265 2 3 15.02

Table ARYSAUTO sample data and relevant field information:

CERVEH PRIMA
2 65.26

My query shows a 0.01 monetary units of difference, since
20.15+30.10+15.02 is not exactly 65.26

Hi Seguros,

I expect that this is a rounding issue. What data types are the various
columns?

Thanks for your help, i hope that this information is enough to fix
this

No, it isn't. As I already stated in my previous reply, I need to know
the table structure ===> as a CREATE TABLE statement <===. I failed to
include that you also need to include all the constraints, properties,
and indexes (you may omit irrelevant extra columns though).

I also need the sample data ===> as INSERT statements <===. And I need
to know the expected results based on the sample data given.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
.



Relevant Pages

  • Re: Query for search engine
    ... > relational database and is not restricted to SQL server. ... > our internet site and SQL for our intranet sites. ... >> Could you please post some DDL, sample data and expected result? ...
    (microsoft.public.sqlserver.programming)
  • Access SUMs Full Column When Using Subquery
    ... I jumped over to SQL Server, and it gave me the results I wanted, so ... Sample Data: Students_02272005_1 ... SELECT clause due to conditions specified on the subquery's WHERE ... Stud_ID Lesson PercentAbove5 ...
    (microsoft.public.access.queries)
  • Re: join on 3 tables for asp output
    ... The table structure and sample data is ... >> Mondays since I am scheduling instruments for a whole week. ... > some outer joins (I'm assuming this is SQL Server, ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: how to conver nvarchar with value like(12.23) to time (12:23)
    ... Can you please give us a script of some sample data to try out? ... Pro SQL Server 2000 Database Design - ... > "Arithmetic overflow error converting expression to data type datetime" ... > INSERT INTO TourItemsTemp (FromTime, ToTime, TimeCodeID, ...
    (microsoft.public.sqlserver.programming)
  • Re: consolidating recordsinto a new table
    ... Compass Technology Management - www.compass.net ... Pro SQL Server 2000 Database Design - ... > HERE IS SOME SAMPLE DATA FROM TABLE B ...
    (microsoft.public.sqlserver.programming)