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 gkittelson 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. dcjeans

    Possible to get a total sum of results from a query?

    I tried changing that line of the query just to try to get past it to this: select RIGHT(C.barcode, 12), C.description, C.size, SUM( U.stock_count) AS "TotalCount", SUM( U.stock_count - C.inventory ) AS "Variance", SUM(U.stock_count - C.inventory * C.cost ) AS...
  2. dcjeans

    Possible to get a total sum of results from a query?

    Strange, Copy/pasted the new syntax, same error, well almost the same, position is different this time. SQL ERROR - [position 175, near '(' in ' SUM( (U.stock_count'] function label expected. I am using Openbase, if that makes a difference. Darron
  3. dcjeans

    Possible to get a total sum of results from a query?

    Thanks for the reply. I tried your query (copy / pasted) and got this error SQL ERROR - [position 162, near '(' in ' SUM((U.stock_count '] function label expected. I am a complete newbie at SQL, so I am unsure how to fix. It appears to me that there is a function label (TotalCount) so...
  4. dcjeans

    Possible to get a total sum of results from a query?

    I have a query for an inventory catalog that looks like this. select RIGHT(C.barcode, 12), C.description, C.size, (select sum(stock_count) from count_update where barcode = RIGHT(C.barcode, 12)) TotalCount, (select stock_count from count_update where barcode = RIGHT(C.barcode,12))-(select...
  5. dcjeans

    Simple query question.

    That worked as well!!! Thanks! You guys have been a big help. Darron
  6. dcjeans

    Simple query question.

    OK, I think I got it!! SELECT RIGHT(barcode,6), stock, location, (SELECT description FROM slow s where RIGHT(s.barcode,6) = RIGHT(l.barcode,6)) FROM last_count l WHERE RIGHT(l.barcode,6) IN (SELECT RIGHT(barcode,6) FROM slow) Seems to work. Thanks again for the help!!! Couldn't have...
  7. dcjeans

    Simple query question.

    Strange, using that query, 5 out of 316 columns had descriptions with them. the rest were blank. hmmm
  8. dcjeans

    Simple query question.

    Thanks for the reply, That is almost what I am needing, I think. Except, the description is in the other table (slow) - the last_count table does not contain the description. I modified the query as follows; (I am only using the right 6 numbers of the barcode because the "slow" table was...
  9. dcjeans

    Simple query question.

    Oops, I listed the wrong query. Here is the one that sorta works. select RIGHT(S.barcode, 6), S.description, (select location from last_count where RIGHT(barcode,6) = RIGHT(S.barcode,6)) Location, (select stock from last_count where RIGHT(barcode,6) = RIGHT(S.barcode,6)) Count from slow s ;
  10. dcjeans

    Simple query question.

    I am having a hard time creating a simple query. I have two tables. "last_count" which has the columns "barcode" "location", and "count" and "slow" which has columns "barcode" and "description". The basic idea, is that "last_count" contains an inventory count of my entire catalog with seperate...

Part and Inventory Search

Back
Top