Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

case when in vb.net as in oracle

Posted on 2014-04-01
1
300 Views
Last Modified: 2014-04-02
I have a code in oracle and it works fine to get sum of TOTAL_CHRG  when dc = 1,4,6 as bonus_value

I would want to get the same results in VB.NET with access 13 database sql but if fails saying "un-recognized key word when"

Help

sum(case when dc in (1,4,6) then TOTAL_CHRG else 0 end) as bonus_value
0
Comment
Question by:Anthony Matovu
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39969502
ms access does not have the CASE WHEN  construct, instead a IIF function, for example:
http://www.techonthenet.com/access/functions/advanced/iif.php
iif ( condition, value_if_true, value_if_false )
or switch function for more elaboration:
http://www.techonthenet.com/access/functions/advanced/switch.php
Switch ( expression1, value1, expression2, value2, ... expression_n, value_n )

hope this helps
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question