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 Mike Lewis 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: *

  1. aumstu

    Do Loop

    This is probably a simple question but I cant figure it out. I am trying to shorten some code by using a Do Loop. What I have are Fields names (Access DB) that are named Q1-Q20 and instead of writing the same code 20 times I am hoping to do something like this. Dim rstIn As New...
  2. aumstu

    Row Count

    I have to learn to pay attention to details....that worked out perfect. I did have to change the last line - and sdbache_stlev = '10' to where sdbache_stlev = '10' but that was my typo. Thanks again and here is a star
  3. aumstu

    Row Count

    Thanks SQLDenis.. I tried to the isnull but since the row does not exists in the Hours Table...it skips over it. I like the coalesce code...Never seen that before. Definitely will use that one day Thanks
  4. aumstu

    Row Count

    I have two tables...one SDBACHE and another Named Hours. Most records in SDBAHCE have a value in the table Hours...but there are a few records that dont. The code above works great if I take out the When (b.Hours_Earned) @@RowCount = 0 Then '02' Wwhenever a row does not exists in the...
  5. aumstu

    Row Count

    I am writing a case statement and need to add a value if the row count is 0 ...Here is my code update A Set SDBACHE_STLEV = CASE When (b.Hours_Earned) Between 0 and 27.990 Then '02' When (b.Hours_Earned) @@RowCount = 0 Then '02' When (b.Hours_Earned) Between 28 and 57.990 Then '03' When...
  6. aumstu

    Select 'X'

    This may not post as a good question because it may be to vague..but I will give it a shot... I am trying to figure out some code that is in PL/SQL...In some of the sql statements that use Select 'X' from dual where fieldname = :ID what is Select X? I have tried this out...but it returns...
  7. aumstu

    Case update statement

    Works great sqldenis! I am liking your code a lot better than mine...much cleaner. Here is a star for yeah Thanks again.
  8. aumstu

    Case update statement

    Thanks SQLDenis..I will give that code a shot and let you know...so far, i set it up like this and it worked out Update EWS SET ews_level = CASE When (Select hours_hours_earned from hours where hours_id = ews_id) Between 0 and 27.990 Then '01' etc.... Else 'Something' End where ews_level =...
  9. aumstu

    Case update statement

    Thnaks for answering.... That update would work great if I was just using one table...but, I need to get the hours from a seperate table. Any ideas.. Thanks
  10. aumstu

    Case update statement

    I am trying to update a table (EWS) by using a case statement. I am able to run this select statement select A.EWS_ID, A.EWS_Level, b.Hours_hours_earned, "NEW STUFF" = CASE When (b.Hours_hours_earned) Between 0 and 27.990 Then '01' When (b.Hours_hours_earned) Between 28 and 57.990 Then '02'...
  11. aumstu

    Covert Decimal to Int

    Thanks again for all your help
  12. aumstu

    Covert Decimal to Int

    thanks... the math is working but whenever I the decimal places are still in the field. The reason I havn't changed to a int is because of the decimal places. The data is imported using a dts package. I think that I will change the field to a int and then multiply by 100 in the dts package...
  13. aumstu

    Covert Decimal to Int

    Thanks sqldenis...Is the precision that the decimal place could be to? the results are 5 2 The name of the table is SDBHOURS thanks
  14. aumstu

    Covert Decimal to Int

    I am trying to convert decimal numbers into a number without decimals… Sample Data Now Needs to Be 23.00 2300 68.67 6867 42.36 4236 All the decimals are two places. I have used this sql statement to view the data select table_hours, cast((table_hours * 100) as int) AS NewHours From...
  15. aumstu

    Can anyone Reduce this code to one SQL statement

    Thanks for the replies... Geoka, I think the code would work great if I only had one ID, I did not mention in the orginal post that there are several different IDs. So, this code returns the max and min for the entire table. I think I will just use the two sql statements for now and take...
  16. aumstu

    Can anyone Reduce this code to one SQL statement

    Thanks for responding… I need to get the Max Activity Date (there are two dates that match 2003-02-13) and the Min Admit Date (which would be 200302 and not the 200303) I could only do this using two statements…I imagine that there has to be a faster way Thanks again
  17. aumstu

    Can anyone Reduce this code to one SQL statement

    What I am trying to do is get the Max Activity Date and the min admit date. Here is the Data... ID Effect Date Admit Date Activity Date 17189 199603 199201 1997-04-14 17189 200303 200303 2003-02-13 17189 200302 200302 2003-02-13 17189 199503 199201 1995-11-15 17189 199201 199201 1995-11-15...
  18. aumstu

    Leading Zeros for Integer

    Thanks for inputs...I am sure that some arithmetic we be done on some of the fields but that will be on their end...I will leave it varchar and let them import it the way they need to... thanks again
  19. aumstu

    Leading Zeros for Integer

    If this DB will be exported to a text file...then if I am thinking right, it will not matter if my data type is an integer or a varchar b/c the text file will have to be imported into their system. Would anybody disagree with the above statement? thanks and thanks for responding
  20. aumstu

    Leading Zeros for Integer

    Thanks SQLDenis....I have to export the DB to a text file and I will do the conversion there...thanks for the info

Part and Inventory Search

Back
Top