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: WaveOut
  • Content: Threads
  • Order by date
  1. WaveOut

    I have a view that returns the foll

    I have a view that returns the following: select * from latest_report projectname contractor_name date Barry O&M Vulcan 01/01/2007 Barry O&M Vulcan 02/01/2007 Barry O&M Vulcan...
  2. WaveOut

    Stored Procedure to duplicate record(s)

    I would like to duplicate some records in a table. The table name is Craft and it has the following fields: id - integer (Identity = Yes) week_UID - uniqueidentifier craft_ID - integer craft_group - integer craft_name - nvarchar craft_category - nvarchar craft_count - integer...
  3. WaveOut

    Sum count by day then return max

    Hello, I have the following data: Craftname day_of_week count Craft 1 Monday 2 Craft 2 Monday 8 Craft 3 Monday 3 Craft 4 Monday 5 Craft 1 Tuesday 1 Craft 2 Tuesday 4 Craft 3 Tuesday 1 Craft 4...
  4. WaveOut

    Lookup data in one table and move to another

    I need help with the following: I have two tables. The first table, Craft_temp, contains the following fields: craftID craft_group craft_name craft_cateogry 1 1 Carpenter A Carpenter 2 2 Carpenter B Carpenter 3...
  5. WaveOut

    sql calculations

    I need to sum several fields then take product and use it in another calculation. For example: select sum(day_hrs)+sum(night_hrs)+sum(day_ot_hrs)+sum(night_ot_hrs) as total_hrs from Craft where weeklyuid = @weekid and craft_category = 'Boilermaker' select...
  6. WaveOut

    Help with math forumla within sql statement

    I need to calculate the following formula within an sql statement: --Tsat = Ax + B/x + C(x^0.5) + D(ln(x)) + E(x^2) + F(x^3) + G My first attempt is like so: Local a real; Local b real; Local c real; Local d real; Local e real; Local f real; Local g real; Local Tsat real; Local P real; a =...
  7. WaveOut

    Join two select statements

    I have the following two select statements: SELECT ts,max FROM aggregates WHERE name like '3B-HP-DRM-SKIN-1-T' AND ts between '14-JUN-06 08:32' AND '14-JUN-06 22:26'; SELECT ts,max FROM aggregates WHERE name like '3B-HP-DRM-SKIN-2-T' AND ts between '14-JUN-06 08:32' AND '14-JUN-06 22:26'...
  8. WaveOut

    Stored Proc to update one table with data from another table

    My tables: CRAFT TABLE id weeklyuid craftname wage WAGERATE TABLE id craftid plantid wagerate I have two tables craft and wagerates. I want to sort the craft table on the weeklyUID field and update all records that meet the sort criteria with a wage rate that is looked up in the wagerate...
  9. WaveOut

    Update table

    I want to write a query that will replace the contents of a column with 1 thru 162 until it replaces them all. I have something like this: UPDATE Craft_temp SET craftID = id WHERE id < 163 This replaces the first 162 items ... now I need to do the same thing 6 more times...
  10. WaveOut

    Copy one table to another

    Hello, I would like to copy the contents of one table to another with the following twist ... I need to copy the entire table just as it is except for one field. I want to supply the value for this one field. Example: Table1 id 1 firstname John lastname Doe wage...
  11. WaveOut

    Combine two tables

    I have two tables that contain the following fields: Commodities Table ID Company_ID Type Sub_Commodities Table ID Commodities_ID Sub_Type I need a sql statment that will join these two tables together and group them by Commodities.type. Thanks, David
  12. WaveOut

    Returning a Timestamp from stored procedure to excel

    My stored procedure looks like this: FUNCTION Get_Min(start_time timestamp, end_time timestamp, mytag char(24), myvalue integer) Local mytime timestamp; mytime = (select min(ts) from history where name like mytag and value > myvalue and ts between start_time and end_time); return mytime; end...
  13. WaveOut

    Assign SQL Variable to VBA Variable

    I'm executing the following query: mysql = "local oilhours real;oilhours = 0;for(select * from aggregates where name = 'AA-FO-MFM' and period = 600 and avg > 15 and (ts > '01-jan-04' and ts < '01-feb-04') do oilhours = oilhours + 1;end;" when I execute the above query .... oilhours = 36.6...
  14. WaveOut

    Store query result into variable

    I'm executing the following query: mysql = "local oilhours real;oilhours = 0;for(select * from aggregates where name = 'AA-FO-MFM' and period = 600 and avg > 15 and (ts > '01-jan-04' and ts < '01-feb-04') do oilhours = oilhours + 1;end;" when I execute the above query .... oilhours = 36.6...
  15. WaveOut

    Insert calculated value into Excel

    I need help getting a calculated number into excel. I use the following sql statement: ADO_rs.Source = "select ct_off_time, least(2+(0.044117*CT_OFF_GEN),8)/count(*) as mydata2 calculate avg from b_NRatio" 'it returns the following (which is correct): ct_off_time mydata2...
  16. WaveOut

    put calculated number into excel

    I need help getting a calculated number into excel. I use the following sql statement: ADO_rs.Source = "select ct_off_time, least(2+(0.044117*CT_OFF_GEN),8)/count(*) as mydata2 calculate avg from b_NRatio" 'it returns the following (which is correct): ct_off_time mydata2...
  17. WaveOut

    Please help with sql statement

    Here are my access tables: PART TABLE { part_id manufacturer part_number part_name } PLANT TABLE { plant_id plant_name plant_address plant_phone } INVENTORY TABLE { inventory_id part_id plant_id quantity } I want to run a query that will display all of the parts that exist at mutiple plants...

Part and Inventory Search

Back
Top