All Forums Database
curtdugg 1 post Joined 10/14
24 Oct 2014
convert month number to month name

Hello everyone; I am new to the forum and want to say hello to everyone. I am a system programmer working with SQL 2008R2, 1 month on the job and just got put on a major projects and I am drawing a blank wondering if someone could help me out.
I have  two tables on one database table1 is customers table and table2 is Inventory table. I need to compare the customer to the inventory to see if forms are obsolete or out of stock. the code I am working with is like this.
select *,
'[tblCSSCustUpdate].Status' = CASE
WHEN tsg.Obsolete='N' THEN 'Out of Stock'
WHEN tsg.[Inventory on Hand]= '0.000' THEN 'Out Of Stock'
--else 'FulFilled',
WHEN tsg.Obsolete='Y' THEN 'N/A'
-- WHEN tsg.Obsolete='N' THEN 'Completed'
WHEN tsg.[Inventory on Hand]= '> 0' THEN 'Completed'
else 'New'
FROM [CSSFulfillment].[dbo].[tblCSSCustUpdate] cust left join
[CSSFulfillment].[dbo].[tblTSGInventory] tsg on
cust.FORMIDNUM = tsg.[Item ID]
But, this is giving me a new column and not change the exist status column??.. can someone please help me out.
Thanks in advance for any help.

dnoeth 4628 posts Joined 11/04
24 Oct 2014

I don't get what you want, the title is about month number/name, but the T-SQL snippet is something totally different.
And then you ask why the CASE doesn't change the existing status?
Can you explain what's your actual problem?
Converting T-SQL to Teradata SQL, converting month number to a month name, coding an Update???


You must sign in to leave a comment.