Viewing 15 posts - 14,551 through 14,565 (of 15,381 total)
neillewis (6/9/2011)
That is exactly what I was after. Just one tiny thing I had to change the Declare @NewVal to set the value separately i.e.
declare @NewVal char(1)
SET ...
June 9, 2011 at 8:27 am
neillewis (6/9/2011)
It's always the 12th for this update and it is updating it to the same number
That is a strange request but here you go.
create table #num
( val decimal(19,0))
insert #num...
June 9, 2011 at 8:07 am
You might be able to just drop the primary key on that table and add the dummy records with the new value long enough to allow you to change the...
June 9, 2011 at 7:10 am
Tiya (6/8/2011)
even if price is coming that doesnt matter but my objective is to find average of 750 speeed.that is 850+950/2= 900
Like I said remove price from your query and...
June 9, 2011 at 7:01 am
Tiya (6/8/2011)
I USED THIS QUERY AND THIS IS RETURNING CORRECT FOR ALL EXCEPT 750 BUT I WANT AVERAGE FOR 750 ALSO...(like it has to be 850+950/2 = 900)
________________________________________________________________________
SELECT PRICE,AVG(PRICE) as...
June 8, 2011 at 3:09 pm
There is not enough information or clarity about what you are trying to do. Please see the link in my signature for best practices on posting questions.
June 8, 2011 at 2:47 pm
There are so many problems with that code it is hard to know where to start. Every single parameter is a varchar regardless of the actual datatype (dates, ints, etc)....
June 8, 2011 at 2:36 pm
So where is the problem? There is a lot of unfinished code in here. Are your table variables being filled correctly? You are not using those table variables in the...
June 8, 2011 at 2:26 pm
Since this is a one time data fix maybe you could insert a record with the bad snumber into the original table (assuming it is not the primary key). This...
June 8, 2011 at 2:03 pm
Sriram.RM (6/7/2011)
you can use Upper()/Lower() function to overcome issues related case sensitive issues or look at collation...
those functions won't help you unless you are in a case sensitive collation.
Try...
June 8, 2011 at 12:35 pm
Try looking at the article that Jeff posted and wrote. It will be MUCH better for you to learn the topic instead of a quick fix shortcut and be stumped...
June 7, 2011 at 3:50 pm
Update a column snumber? What table? This is totally vague but I am assuming you are trying to do something like
update table3 set snumber = [some value] where snumber =...
June 7, 2011 at 3:34 pm
bopeavy (6/7/2011)
June 7, 2011 at 3:29 pm
Try something like this.
create table #IDXRaw
(
invoice int,
MEASURE varchar(5),
Provider varchar(50)
)
create table #invoices
(
INVNUM int,
MEASURE varchar(5)
)
insert #IDXRaw
select 1, 'gal', 'provid1'
union all
select 1, 'gal', 'provid 1'
union all
select 1, 'gal', 'provid1'
union all
select 1, 'gal', 'provid12312'
union...
June 7, 2011 at 12:20 pm
Viewing 15 posts - 14,551 through 14,565 (of 15,381 total)