Solved

case when in vb.net as in oracle

Posted on 2014-04-01
1
295 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 142

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

Suggested Solutions

Title # Comments Views Activity
SQL Query 34 82
C# HTTP GET method sample code 3 42
Vb. Net application freezes 9 30
oracle- set role and grant privileges 6 14
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

861 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now