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

    percent problem

    I'm trying to get a simple percentage but they keep adding instead of becoming a percentage. select contract, sum(IIF(subqry.ACCEPTED + subqry.DECLINED=0,0, subqry.ACCEPTED / (subqry.ACCEPTED + subqry.DECLINED))) as RATE from subqry where...
  2. LloydDobler

    update record if field is null, else insert

    Hi all, hopefully an easy one...First, here's my Table Rec# EMP# timeOUT timeIN 1 4 11:30 12:05 2 4 12:30 -- 3 9 11:05 11:15 4 10 11:45 --- What I'd like to do is when inserting a new record, to check...
  3. LloydDobler

    divide by zero

    Hi all, getting a divide by zero error, even with a CASE statement. Am I missing something? CASE WHEN SUM(QuantityProduced)= 0 THEN 0 ELSE SUM((QuantityProduced - scrap) / QuantityProduced) end AS QUALITY fields QuantityProduced and Scrap are both numeric. Using Query analyzer and SQL 2K...
  4. LloydDobler

    ROLLING TOTAL QUERY

    I need to create a query that helps satisfy this: I need to calculate a monthly savings...easy enough, just divide annual savings by 12. But I need to calculate the annual savings based on the month the project was implemented (DATE field). so, my annual savings for P#1 would be 12,000, whereas...
  5. LloydDobler

    Query help

    Can someone point me in the right direction on finding some info on the following? I need to create some queries that will detail the size in KB of all tables, indexes along with their row counts, as well as schema names, table and index names as well. I've searched this forum, BOL, google, but...
  6. LloydDobler

    rows as columns matrix query or view

    Hi all, hoping someone can help with this and let me know if it's even possible: I have a table of training results, which needs to be displayed in a matrix, here's my table and desired output: table A EE TMOD LEVEL 1234 first aid 1 1111 first aid...
  7. LloydDobler

    linked server hangs

    Hello all. I have a linked server (to an AS400). When I try to view the tables/views from the local server, I see everything fine, however, when I'm not at the local server, and just accessing through a client, when I click on the table/views to see what's there (in EM) it just hangs and doesn't...
  8. LloydDobler

    Linked server hangs

    Hello all. I have a linked server (to an AS400). When I try to view the tables/views from the local server, I see everything fine, however, when I'm not at the local server, and just accessing through a client, when I click on the table/views to see what's there (in EM) it just hangs and doesn't...
  9. LloydDobler

    Conditional formatting for a graph

    Is there a way I can make bars on graphs appear in a different colour based on the value? I know I can do conditional formatting on the cell, but I want to go one step further and apply it to the graph as well. "I don't want to sell anything, buy anything or process anything as a career. I...
  10. LloydDobler

    query help-union?

    need to be able to make the following table structure: issue#, date, cust, part1, qty1,part2, qty2, part3, qty3...(up to 6 parts) look like: issue date cust part qty 222 3/3/07 GM 123 4 222 3/3/07 GM 246 2 222 3/3/07 GM 444 7 223 3/8/07 GM 123 9 224 3/10/07 HONDA xyz 2 224 3/10/07 HONDA...
  11. LloydDobler

    case date help?

    Hello all, I have 2 tables I'm looking to query. Here's what I have so far: SELECT S.Machinenumber, S.StartingDate, S.frequency, E.PMdate, CONVERT(varchar(10), DATEADD(dd, S.frequency, E.PMdate), 101) AS NEXTPMDATE, S.task FROM dbo.tbl_PM_Schedule S LEFT...
  12. LloydDobler

    bullet list from database field

    Hi all. I'm trying to make a bulleted list from a database field. Here's my issue: The field is a nvarchar (4000) character field from a MSSQL server, and the bullets need to be placed after each 'responsibility'. I can copy the text from MSWORD to the input page, and it displays the bullets...
  13. LloydDobler

    day of week question

    Is there any way I can turn the following code into the desired results? I currently only get 'A shift' showing up DESIRED RESULTS: shift MON TUES WED THU FRI A 1.2 3.2 0 0 0 B 0 0 0 0 0 C 0 0 0 0 0 SELECT...
  14. LloydDobler

    select max date

    Hi all, hope someone can help me with this one... I have a view in which I need to display a max date. Here's the structure EE# TrMod CompDate Vendor 1234 WHMIS 2/4/4 Joe's training 1234 1st Aid 2/5/6 BTC 1234 WHMIS 2/4/6 TCBY In this case, of...
  15. LloydDobler

    scheduled DTS package fails

    I'm trying to set schedule a DTS pkg to run, but I keep getting the following error: Error = -2147217865 (80040E37) Error string: Invalid object name 'tbl_test_DTS'. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 Error Detail...
  16. LloydDobler

    send outlook task from SQL

    Does anyone know if it's possible to send an email task to outlook from SQL 2000, like when a sproc or trigger fires and email, instead it sends it as an outlook task? "I don't want to sell anything, buy anything or process anything as a career. I don't want to sell anything bought or...
  17. LloydDobler

    query or CASE help

    Looking for some help on this query. I need to count a column (parts) where the stock on hand (SOH) is => the safety stock (SAFETY), then divide that into a count of total parts. Here's table structure PLANT PART SOH SAFETY 1 abc 50 50 1 xyz 40 50 1...
  18. LloydDobler

    union help

    HI all, How would I create a column indicating the scrap type in the union statement below? SELECT SUM(CASE datepart(mm, [prddate]) WHEN 1 THEN prdscrap ELSE 0 END) AS JANSCRAP, SUM(CASE datepart(mm, [prddate]) WHEN 2 THEN prdscrap ELSE 0 END) AS FEBSCRAP FROM tbl_production WHERE...
  19. LloydDobler

    CASE statement possible in Access?

    Hi everyone, I'm trying to use a query from SQL in Access and am wondering if this is possible. SELECT division, SUM(CASE datepart('y', [date initiated]) WHEN datepart('y', getdate()) THEN 1 ELSE 0 END) AS CHYTD, SUM(CASE datepart('m',[date initiated]) WHEN 1 THEN containmenthrs ELSE 0 END)...
  20. LloydDobler

    CASE query help

    Could use a little help on a select statement. Is there anyway I can do a CASE statement to return results that will show a percentage of on time receipts? I'm doing a count of the 'expiredate' for that time frame, and doing a sum of the 'ontime' value, but I want a percent as my final number...

Part and Inventory Search

Back
Top