Solved

case when in vb.net as in oracle

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

757 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

20 Experts available now in Live!

Get 1:1 Help Now