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...
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...
Hello everyone,
I am trying to calculate the percentage.
ICount is what percentage of FaCount, I keep getting 0 in the percentage column, what am I doing wrong.
Thank you for reading this post
select * ,(ICount / FaCount) * 100 AS Percentage
from religionCounts
Facility ICount Religion...
Hello everyone
I am not sure how to proceed. I would like
to divide recidivism / releaseDate
select count(*) from recidivism
select count (*) from releaseDate
Thank you for helping if you can.
Hello everyone,
I am trying write a sql statement that would give me the student id for everyone in the room.
There are 3 students in a room , I know the student ID of 1
student.
I believe I need to compare the movein and moveout dates
with this (Student = 10056936), not really sure how...
I am trying my first statement, I am not sure why I am getting an error.
I am try to say if the transaction type (TXTYPE)= 'OPENING BALANCE'
then show all transactions from 0 to 50$
If not show all transactions that are purchases represented
by < 0
CASE
IF ([SQL1].[TXTYPE])= 'OPENING'...
Hello everyone I am trying to write this select statement in sql
The report should be for those patients admitted more than 2 days prior but less than 7 days prior to the date of the report.
I have just started learning sql, please help if you can.
I am not sure if I am writing this...
Hello everyone I am not sure how to write this sql statement correctly,please help.
I have 4 columns below
The 2 left columns are flags that can be set as Y or N depending on the values in the right columns
If any column on the right is not null
the flags on the left should read AnyDet = 'Y'...
Hello everyone I am totally stuck, I am trying to subtract 1 day from the day part of this expression, appreciate your help, thank you for reading the post.
@[User::FileDate] +
(DT_STR,4,1252) DatePart("yyyy",getdate()) +
Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
Right("0" +...
Hello everyone, I cannot figure out what I am doing wrong here. My goal is to show all cells in a housing unit where 3 or more inmates are housed. When I run the sql statement below I get cells with 2 inmates and cells with 3 inmate. I only want to see cells with 3 inmates in them, please help...
Hello everyone please help if you can, I am trying to write a query that shows me every cell in a housing area that has 3 inmates , when I run what I have written I see cells with 2 and 3 inmates. Please advise
Thank you for helping.
select offender...
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.