Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: IAMINFO
  • Content: Threads
  • Order by date
  1. IAMINFO

    Pass data from a lookup table

    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)...
  2. IAMINFO

    Integer Lowest Order

    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
  3. IAMINFO

    Integer lowest order

    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.
  4. IAMINFO

    Max Row from a group

    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...
  5. IAMINFO

    Sql Looping

    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...
  6. IAMINFO

    Looping

    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...
  7. IAMINFO

    While Loop

    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)...
  8. IAMINFO

    Dynamic Variable

    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...
  9. IAMINFO

    Case Statement

    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...
  10. IAMINFO

    SQL Division

    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.
  11. IAMINFO

    Count Consecutive Days

    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...
  12. IAMINFO

    Percentage Calculation

    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...
  13. IAMINFO

    SQL Division

    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.
  14. IAMINFO

    SubSelect question

    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...
  15. IAMINFO

    CASE Statement

    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'...
  16. IAMINFO

    Select Statement

    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...
  17. IAMINFO

    Update Statement using IF or Else

    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'...
  18. IAMINFO

    Date Subtraction in Expression

    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" +...
  19. IAMINFO

    SQL Count

    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...
  20. IAMINFO

    SubQuery Count

    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...

Part and Inventory Search

Back
Top