SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 31st, 2004, 06:45 AM
GUID GUID is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 69 GUID User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 45 m 29 sec
Reputation Power: 5
Question Update 1 Column with Multiple SET & WHERE clauses?

I have one column which holds the Month (column_name is Mth) abbreviated as string (such as Jan, Feb etc).
I want to update another column so that a new column (Month) is updated with a number 1, 2, etc depending on Mth.

I've been giving myself a headache with something like this so far... getting now where... any help would be great.

UPDATE Rev2004Translation
SET Rev2004Translation.Month = 1 WHERE Rev2004Translation.Mth = "Jan";

UPDATE Rev2004Translation
SET Rev2004Translation.Month = 2 WHERE Rev2004Translation.Mth = "Feb"

It's for an Access DB.

Reply With Quote
  #2  
Old September 1st, 2004, 01:29 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
For starters I disagree with your table design (it isn't normalized) but that isn't your problem



UPDATE Rev2004Translation
SET Rev2004Translation.Month = (IIF(Rev2004Translation.Mth = "Jan",1,IIF(Rev2004Translation.Mth = "Feb",2,.....)))


S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Update 1 Column with Multiple SET & WHERE clauses?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT