Re: Access Project
From: Ron Weiner (weinNoSpam1_at_mindspring.com)
Date: 10/08/04
- Next message: Ron Weiner: "Re: One form to multiple databases?"
- Previous message: Van T. Dinh: "Re: Continuous Subform / Form - Orphan records"
- In reply to: Dib: "Access Project"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 8 Oct 2004 08:19:57 -0400
Dib
Although I have never worked in an Access ADP I believe you need to use TSQL
syntax (as Sql Server is the database engine), and as you have discovered
there is no IIF() in TSQL.
You probably want to replace the IIF() constructs with TSQL CASE function.
Sql Server BOL has a good explanation and lots of examples. For your
specific example it might translate like this:
SELECT This, That,
CASE Type
WHEN 1 THEN Cost*UnitSell
ELSE 0
END AS AndTheOther
FROM WhateverTable
WHERE SomeCondition
ORDER BY This, That, AndTheOther
CASE is far more flexible (and structured) than the IIF() function
especially when one has many WHEN conditions.
Ron W
"Dib" <dNOSPAMshahene@conNOSPAMsoftware.com> wrote in message
news:u1XmkNJrEHA.2696@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> How can I make this part of the sql work in a Access Project (.ADP)
>
> SUM(IIF(Type=1,Cost*UnitSell,0))
>
> this is returning and synetx near =
>
> Thanks
> Dib
>
>
- Next message: Ron Weiner: "Re: One form to multiple databases?"
- Previous message: Van T. Dinh: "Re: Continuous Subform / Form - Orphan records"
- In reply to: Dib: "Access Project"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|