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

    CREATE VIEW problems

    My servers DB is using MySQL ver4.1.10. I need to use a query in the type CREATE VIEW CREATE VIEW currentCostOfStock AS SELECT P.partName, P.partNo, P.manufacturer, S.vehicleType, S.years, S.price, S.stockLevel, S.price * S.stockLevel AS productCost, SUM productCost AS stockCost FROM Parts...
  2. omgm1ke

    Average Time Query

    Thanks r937, your query worked a charm! rac2, your query brought back NULL, but thanks anyway.
  3. omgm1ke

    Average Time Query

    I have come stuck with averaging a column with type of Time. I know there is a function AVG() that I can use to filter the average of a column, however, this brings back an integer. Is there any way to return the average in time format (IE 00:00:00)? BACKGROUND INFO: SELECT `estimatedTime`...
  4. omgm1ke

    Average Time Query

    Thanks for all the help guys. It's got me on the way.
  5. omgm1ke

    Average Time Query

    The data type is time, and the default is 00:00:00. Thinking about it, the best default will peobably be 00:00. However, for the sake of getting this problem sorted I will leave it at 00:00:00.
  6. omgm1ke

    Average Time Query

    Cool, SELECT `estimatedTime` FROM job_sheet; Returns, 01:00:00 21:30:00 01:00:00 If the data in the table were all 01:00:00 the AVG query returns 10000. I threw in the 21:30:00 to test.
  7. omgm1ke

    Average Time Query

    Ok, for example: SELECT AVG( `estimatedTime` ) FROM job_sheet; Returns: 77666.666666667 Which should be something like 07:76:66 (ignoring the everything after the decimal). Which obviously should be 08:17:06... I think... you get what I mean LOL. It should be this because it is the answer...
  8. omgm1ke

    Average Time Query

    I have come stuck with averaging a column with type of Time. I know there is a function AVG() that I can use to filter the average of a column, however, this brings back an integer. Is there any way to return the average in time format (IE 00:00:00)?

Part and Inventory Search

Back
Top