Solved

case when in vb.net as in oracle

Posted on 2014-04-01
1
302 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
[X]
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
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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

729 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