Solved

case when in vb.net as in oracle

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

749 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