gmmastros I cannot thank you enough , if it's ok I would like to make a donation in your name to tek-tips, I have to give back some kind of way.
Thank you if not tek-tips tell me your favorite charity or something. I really appreciate this.
gmmastros the numbers table have one column named numdata
which is varchar(5) the values in the column are like this
59345
48374
32953
I need the output to be
34559
34478
23359
Thank you for responding gmmastros
kjv1611 thank you for taking the time , I am still looking at this I believe I might have to explore writing cursor or use a while loop, any thoughts.
The error pertains to this line
Set @rd = (select numdata from numbers)
gmmastro I am still having a problem,you provided me with this code it works great for a single value, when I try to select from my lookup table I get a error message that says
Subquery returned more than 1 value. This is not permitted.
What am I missing? Thank you
Declare @rd VarChar(20)...
Hello everyone ,I have a number 80505 how would I use sql to show the number as 00558, not really sure where to start. I need to apply this to multiple rows.
Thank you
Hello everyone ,
I have a number 80505 how would I use sql to show the number as 00558, not really sure where to start.
Thank you for taking time to read this post.
Hello everyone,
The following sql
Select Severity,Offender,Descr
from chargeview
where offender = 16744 and eclock is null
produces the following result set
severity offender descr
99300 16744 vop
14200 16744 agg asslt
99904 16744...
Hello everyone,
I need your guidance if possible, the output of my sql statement produces 12 months of data and stops.
I am not sure how to increment the @ReleaseYear by +1 to continue with the loop and retrieve the next 12 months of data, until I reach the @FinalReleaseYear = 2003
Please...
Hello in the code below I am manually plugging in the year
to insert 12 months of data into a table.
I would like to increment the year by 1 each time 12 months of data is inserted until I get to 2011. Not quite sure how to do this. Thank you for reading and taking time
DECLARE @MoveInYear...
The statement below returns data for the 12 months of year 2000. I am not sure how to increment the year by 1 and loop through again to insert data for year 2001.
Any thoughts or examples would be appreciated, thank you for reading.
DECLARE @ReleaseMonth int
DECLARE @ReleaseYear varchar(10)...
Hello in the statement below I have 2 variables that I set manually, I need to execute this statement up to present month and year.
How could I accomplish this without manually setting the year and month each time, can anyone explain what I need to do or help. Thank you for taking time...
Hello everyone as you can see in this case statement
my result set returns a row with 5 columns for the period of 4/4/2009 thru 4/11/2009
I need the next row to do the same for the period of 4/12/2009 thru 4/30/2009, not sure how to proceed, please help if you can thank you for reading this...
Thank you gmmastros that worked, question
How would I do this with 2 different column names with integer data types
select CAST(858426/9393.0 AS DECIMAL(10,2))
select CAST( ColA/ColB AS DECIMAL(10,2))
Hello everyone,
When I run the select statement below, sql returns 91.00
When I use a calculator, the return is 91.389971
I would like the return to be 91.38, what am I doing wrong?
select CAST(858426/9393 AS DECIMAL(10,2))
Thank you for taking time.
Hello everyone I am learning sql and I am not sure how to
proceed.
I need to get a list of names that have a balance of 5.00 or less for the last 30 consecutive days.
Please help or guide me to an example
I might study. Thank you very much for taking the time
select...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.