DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SQL Query Question

  1. #1
    Tom Guest

    SQL Query Question


    How would I convert the following MS Access query to SQL Server:

    SELECT Sum(IIf([dbo_PBAEntry]![NewRenAutoFleet]<>0,[dbo_PBAEntry]![ExpAutoFleet],0))
    AS Expr3, Sum(IIf([dbo_PBAEntry]![NewRenAutoPremium]<>0,[dbo_PBAEntry]![ExpAutoPremium],0))
    AS Expr4, Sum(IIf([dbo_PBAEntry]![ExpAutoFleet]<>0,[dbo_PBAEntry]![NewRenAutoFleet],0))
    AS Expr1, Sum(IIf([dbo_PBAEntry]![ExpAutoPremium]<>0,[dbo_PBAEntry]![NewRenAutoPremium],0))
    AS Expr2
    FROM dbo_PBAEntry;


    Thanks Tom

  2. #2
    Adelle Hartley Guest

    Re: SQL Query Question


    Tom <tdaffron@kempes.com> wrote in message news:3abfe1e0$1@news.devx.com...
    >
    > How would I convert the following MS Access query to SQL Server:
    >
    > SELECT

    Sum(IIf([dbo_PBAEntry]![NewRenAutoFleet]<>0,[dbo_PBAEntry]![ExpAutoFleet],0)
    )
    > AS Expr3,

    Sum(IIf([dbo_PBAEntry]![NewRenAutoPremium]<>0,[dbo_PBAEntry]![ExpAutoPremium
    ],0))
    > AS Expr4,

    Sum(IIf([dbo_PBAEntry]![ExpAutoFleet]<>0,[dbo_PBAEntry]![NewRenAutoFleet],0)
    )
    > AS Expr1,

    Sum(IIf([dbo_PBAEntry]![ExpAutoPremium]<>0,[dbo_PBAEntry]![NewRenAutoPremium
    ],0))
    > AS Expr2
    > FROM dbo_PBAEntry;


    Check out
    http://support.microsoft.com/support...ase_csexps.asp

    Adelle.

    _____________________________________________________________
    Impress your friends. Become an SQL guru.
    http://www.sql-guru.com




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center