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

    Order By Sequence SQL - Need Help

    select distinct homelaborleveldsc2 from vp_person and employmentstatus = 'Active' order by homelaborleveldsc2 Results: District 1 District 10 District 11 District 12 District 2 District 3 District 4 District 5 District 6 District 7 District 8 District 9 Drivers Home Office Regional Office...
  2. wheels0323

    NULL VALUE Problem

    SELECT TTBL.RD_DISTRICT, TTBL.LOCATION, JOBTITLE, NAME, JOB_ENTRY_DT, SORTORDER FROM (SELECT RD_DISTRICT, LOCATION, JOBTITLE, JOBCODE, SORTORDER FROM (SELECT DISTINCT JOBTITLE, JOBCODE, SORTORDER=CASE WHEN JOBCODE = 1231 THEN 1 WHEN JOBCODE = 1405 THEN 2...
  3. wheels0323

    Extra row with null values I need to get rid of

    I can't do that b/c there are certain jobcodes that dont need data to come back for it, but I still need to show null. Yet these two jobcodes are the same job, and I need only one row to come back for each.. Either one row with data and the person info, or one row with the jobtitle and all...
  4. wheels0323

    Extra row with null values I need to get rid of

    SELECT TTBL.RD_DISTRICT, TTBL.LOCATION, JOBTITLE, NAME, Date, SORTORDER FROM (SELECT RD_DISTRICT, LOCATION, CONVERT(CHAR(26), JOBTITLE) as JOBTITLE, JOBCODE, SORTORDER FROM (SELECT DISTINCT CONVERT(CHAR(26), JOBTITLE) as JOBTITLE, JOBCODE, SORTORDER=CASE WHEN JOBCODE = 1231 THEN...
  5. wheels0323

    Question on how to grab 'next' value in query

    I know I could do something like this select distinct LOCATION, ISNULL((SELECT top 1 CONVERT(CHAR (26), JOBTITLE) FROM dbo.PS_RD_EMPLOYEES_VW B WHERE JOBCODE IN ('2336','2337') AND B.LOCATION = A.LOCATION), 'Grocery Operations Manager')AS GOM, (SELECT top 1 NAME FROM dbo.PS_RD_EMPLOYEES_VW B...
  6. wheels0323

    Question on how to grab 'next' value in query

    ISNULL((SELECT top 1 CONVERT(CHAR (26), JOBTITLE) FROM dbo.PS_RD_EMPLOYEES_VW B WHERE JOBCODE IN ('2336','2337') AND B.LOCATION = A.LOCATION), 'Grocery Operations Manager')AS GOM, (SELECT top 1 NAME FROM dbo.PS_RD_EMPLOYEES_VW B WHERE JOBCODE IN ('2336','2337') AND B.LOCATION = A.LOCATION)AS...
  7. wheels0323

    Round to one decimal place from two datetime values

    Need help rounding to one decimal place from two datetime fields. So far I have. SELECT PERSONNUM, ROUND(convert(decimal(10,1), datediff(minute, shiftstartdate, shiftenddate) / 65.0), 1) FROM VP_SCHEDULE WHERE PERSONNUM = '016902' AND SHIFTSTARTDATE = '2007-03-27 06:00:00.000' That brings...
  8. wheels0323

    Adding Fields In SQL by Increments

    Nevermind. Figured it out. I suck.
  9. wheels0323

    Adding Fields In SQL by Increments

    DECLARE @ITbl TABLE ( laborlevelname3 VARCHAR(50), laborlevelname4 VARCHAR(50), personfullname VARCHAR(64), personnum VARCHAR(15), Age INT, applydate DATETIME, personid INT, TotalSecondsDay...
  10. wheels0323

    Adding Fields In SQL by Increments

    select personnum, timeinseconds, wageamount, applydate, startdtm, enddtm from vp_totals where personnum = '103786' and applydate >= '2008-11-30 00:00:00.000' and applydate <= '2008-12-06 00:00:00.000' and paycodename = '01 REG' Let's say I have the following code. The attachment file is a...
  11. wheels0323

    Help With Converting Numeric Minute Value To Time Value hh:mm

    You are so sexy when your right. I love you. Thank you
  12. wheels0323

    Help With Converting Numeric Minute Value To Time Value hh:mm

    Convert(VarChar(2), MRD.EARLIESTSTARTTM / 3600) + ':' + Convert(VarChar(2), MRD.EARLIESTSTARTTM / 60 % 60) This is what got me close. Yet, it brought back the right values. Just some values that were lets say 15:00 would come back as 15:0
  13. wheels0323

    Help With Converting Numeric Minute Value To Time Value hh:mm

    CASE WHEN i.TotalWeekHoursMinutes > MRW.MAXHOURSNUM THEN 'Worked more than ' + CAST(CONVERT(DECIMAL(5,2), MRW.MAXHOURSNUM / 60.00) AS VARCHAR(5))+ ' total week hours' WHEN i.DayTotalMinutes > MRD.MAXHOURSNUM and i.applydate = i.schoolcalendardt THEN 'Worked more than ' +...
  14. wheels0323

    Help with reporting services and time conversion

    I need a way to convert this field into hh:mm =Fields!TotalTimeSeconds.Value It comes back as total seconds for a day. I need to do this in reporting services somewhere inside the field textbox itself. I was using Convert(VarChar(2), sum(timeinseconds) / 3600) + ':' + Convert(VarChar(2)...
  15. wheels0323

    Convert Seconds to HH:MM in Reporting Services

    An extra /24 just gives me different values. With this formula in sql Convert(VarChar(2), sum(timeinseconds) / 3600) + ':' + Convert(VarChar(2), sum(timeinseconds) / 60 % 60) as TotalTime, I can get it to come back correctly, minus one place behind the value. So it would 21600 seconds would...
  16. wheels0323

    Help with summing fields by another field (SQL programming)

    Thanks. Convert(VarChar(2), sum(timeinseconds) / 3600) + ':' + Convert(VarChar(2), sum(timeinseconds) / 60 % 60) as TotalTime, with this code for time calculations.. is their a way to get two decimal places? so right now.. I have some solutions come back as 25:4 and I need another 0 on that...
  17. wheels0323

    Help with summing fields by another field (SQL programming)

    I have this code. select laborlevelname2, laborlevelname3, personnum, applydate, laborlevelname4, personfullname, laboracctname, timeinseconds, Convert(VarChar(5), DateAdd(Minute, timeinseconds / 60, 0), 108) As HourMin, wageamount, laborleveldsc5 from vp_totals where applydate >= '2007-01-01'...

Part and Inventory Search

Back
Top