Posted on 2011-10-15
Medium Priority
Last Modified: 2012-05-12
Hello experts,
I wants the records in following scenario.
I have 2 different columns in my table Store_Inwards ReceivedQuantiry  and ReceivedQuantityOriginal
I am inserting value in   ReceivedQuantiry while adding records but for some conditions, I need to update the values of ReceivedQuantiry to zero. So before updating ReceivedQuantiry column  I am copying the values to ReceivedQuantityOriginal.
Now I am displaying the values from ReceivedQuantity but I don't want to display values which are zero instead of this i want to get the value from ReceivedQuantityOriginal column for same record.

I want query like following
SELECT MaterialName, CASE When ReceivedQuantity=0 THEN ????
FROM StoreInwards
???? - Means Select values from ReceivedQuantityOriginal column
Question by:Manoj Patil

Accepted Solution

stelth240 earned 2000 total points
ID: 36974218
You would just need to do:

CASE WHEN ReceivedQuantity = 0 THEN ReceivedQuantityOriginal ELSE ReceivedQuantity END.
LVL 19

Author Closing Comment

by:Manoj Patil
ID: 36974262
Thanks for solution. Just a piece of code solve the Problem.

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

What we learned in Webroot's webinar on multi-vector protection.
Microsoft provides a rich set of technologies for High Availability and Disaster Recovery solutions.
Viewers will learn how the fundamental information of how to create a table.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

588 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