Viewing 15 posts - 61 through 75 (of 141 total)
^^ Ill have to chew on your code a bit as im still learning myself. But this is my final and working code.
update aa
set status = 'N'
from people as...
October 2, 2008 at 8:58 am
My result set on the above code looks like this:
dont updateFALLPT2008
updateSPRINGFT2008
updateFALLFT2007
updateSPRINGFT2007
updateFALLFT2006
updateSPRINGFT2006
I just want to update the FIRST SPRING FT 2008 RECORD. Since it has a value of FT instead of...
September 23, 2008 at 4:28 pm
To Clarify:
I know i should provide DDL code to create the table/data but unforunetly I dont know how to do that. BUT, I have the below code:
select case...
September 23, 2008 at 3:57 pm
craig (8/21/2008)
August 21, 2008 at 10:35 am
Not sure where im going wrong here, but I adjusted your code slightly to fit my needs. But when I try to run the update statement I recieve the error...
August 21, 2008 at 10:24 am
Jack Corbett (8/20/2008)
Just a little tip, you should share what you are really trying to do, unless doing that would violate some policy at your office. ...
August 21, 2008 at 9:40 am
Jack Corbett (8/20/2008)
Just a little tip, you should share what you are really trying to do, unless doing that would violate some policy at your office. ...
August 20, 2008 at 2:56 pm
^^ Thank you! I will begin testing this with my actual tables. I wasnt aware you would do an update directly from a case statement.
*edit*
I dont need to directly store...
August 20, 2008 at 2:28 pm
Jack Corbett (8/20/2008)
craig (8/20/2008)
Thanks, but your case statement doesnt take into account for leap years, or peoples birthdays who have yet to occur yet in the current year. But the...
August 20, 2008 at 1:28 pm
rbarryyoung (8/20/2008)
Assuming of course that you cannot just use the UPDATE's WHERE clause (presumably because there are other columns being updated is this same UPDATE statement, according to different criteria)
Can...
August 20, 2008 at 12:45 pm
Jack Corbett (8/20/2008)
You could do this:
[font="Courier New"]UPDATE dbo.Persons
SET title = CASE
WHEN DATEDIFF(YEAR, GETDATE(), birth_date) >= 50 THEN 'Sr'
ELSE 'Jr'
END
[/font]
Thanks, but your case statement doesnt take into...
August 20, 2008 at 12:43 pm
Thanks again, you saved me a bid headache. I just got stumped for some reason, but lesson learned.
April 3, 2008 at 4:17 pm
mtassin (4/3/2008)
Books Online
April 3, 2008 at 4:15 pm
The people code id identifies the person, but the table has a composite primary key with these columns
people_code_id
test_id
test_type
test_date
does this change anything?
April 3, 2008 at 4:13 pm
Can you explain why this doesnt work?
select *
from testscores as ts1
where alpha_score_1 like 'f%'
and not exists (select * from testscores where alpha_score_1 like 'p%')
April 3, 2008 at 4:01 pm
Viewing 15 posts - 61 through 75 (of 141 total)