IF statement from Access query


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: IF statement from Access query

Hybrid View

  1. #1
    Eric Guest

    IF statement from Access query


    I am switching our Access queries to SQL views. How do I make this Access
    97 "IF" statement a SQL 7 "criteria"?

    FollowUp: IIf(IsNull([acct id]),"","Awaiting Follow Up")

    Any help is very appreciated.

  2. #2
    Colin McGuigan Guest

    Re: IF statement from Access query

    Eric <ericb@tfillc.com> wrote in message news:39c24ce1$1@news.devx.com...
    >
    > I am switching our Access queries to SQL views. How do I make this Access
    > 97 "IF" statement a SQL 7 "criteria"?
    >
    > FollowUp: IIf(IsNull([acct id]),"","Awaiting Follow Up")
    >
    > Any help is very appreciated.


    CASE [acct id] WHEN NULL THEN "" ELSE "Awaiting Follow Up" END

    --
    Colin McGuigan




  3. #3
    Eric Guest

    Re: IF statement from Access query


    "Colin McGuigan" <colin@chicor.com> wrote:
    >Eric <ericb@tfillc.com> wrote in message news:39c24ce1$1@news.devx.com...
    >>
    >> I am switching our Access queries to SQL views. How do I make this Access
    >> 97 "IF" statement a SQL 7 "criteria"?
    >>
    >> FollowUp: IIf(IsNull([acct id]),"","Awaiting Follow Up")
    >>
    >> Any help is very appreciated.

    >
    >CASE [acct id] WHEN NULL THEN "" ELSE "Awaiting Follow Up" END
    >
    >--
    >Colin McGuigan
    >
    >
    >

    Thanks, Colin, but I get an error message: "CASE statement not supported".

    Any other ideas?

  4. #4
    Colin McGuigan Guest

    Re: IF statement from Access query

    Eric <ericb@tfillc.com> wrote in message news:39c25b29$1@news.devx.com...
    > Thanks, Colin, but I get an error message: "CASE statement not supported".
    >
    > Any other ideas?


    You're using SQL Server's poor excuse for a View Designer, aren't you? The
    error is a 'Query Definitions Differ' error, or a 'SQL Syntax Errors
    Encountered' error?

    If so, the 'not supported' bit is just telling you that the View Designer
    can't parse the statement. It doesn't mean it's invalid. If it's 'Query
    Definitions Differ', just click 'Yes'. If it's 'SQL Syntax Errors
    Encountered', just ignore it. If you look at your list of views, it should
    show up just fine.

    --
    Colin McGuigan




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