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 TouchToneTommy 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. SyntaxTerror

    Changing Date Style

    Even better! Thanks :D
  2. SyntaxTerror

    Changing Date Style

    Very elegant :) I ended up having to use a varchar 12 and ended up with this beautiful mess. It's ugly... but it works! It starts as a char(6) in 200510 format and ends up as Oct-05 STUFF(CONVERT(VARCHAR(12),CONVERT(DATETIME, (SUBSTRING(MyField, 5, 2) + '-01-' + SUBSTRING(MyField, 1, 4))...
  3. SyntaxTerror

    Changing Date Style

    I'm trying to change a date from 2005-10-01 00:00:00.000 to Oct-05. I would need this to work for any month. How can I do this? I'm using SQL Server 2005. Thanks!
  4. SyntaxTerror

    Stripping dates from something in the WHERE only (not in select)

    SHIZAM! Exactly what I needed. +10 style points to you, sir
  5. SyntaxTerror

    Stripping dates from something in the WHERE only (not in select)

    We have a report where we allow the user to specify a date range and pull all of the purchase orders pulled between the specified dates. Well, there is a problem with the report. The code is like this: WHERE CreatedDate BETWEEN @begindate AND @enddate If the begin date is 2011-06-29 and the...
  6. SyntaxTerror

    Stuck on what kinds of joins to use... Info inside

    I finished the freakin' report! :D 5 temp tables and 9 pages of code later... it's done. ...and runs in 4-6 seconds! :D Not TOO shabby...
  7. SyntaxTerror

    Stuck on what kinds of joins to use... Info inside

    Blarg. Shoot me now. I'm going to dump all of the inventory count data (the IDs of which are in the #temp_counts table) into their own temp table so I can more easily refer to them.
  8. SyntaxTerror

    Stuck on what kinds of joins to use... Info inside

    This calculation would be for Wk1POqty only, so that's what I mean when I mention "PurchaseOrders" in the calculation above.
  9. SyntaxTerror

    Stuck on what kinds of joins to use... Info inside

    My goal is to do the following calculation: CurrentCount(of count0)+PurchaseOrders-CurrentCount(of count1). This will produce the overall inventory utilization by inventory ID. I'd be doing it for multiple weeks, but don't worry about that. Once I can do it for one week, I can do it for all...
  10. SyntaxTerror

    Stuck on what kinds of joins to use... Info inside

    I am pulling from a few temp tables and am not sure how to join them so I get the right results. The goal is, in essence, to make the following calculation: InventoryCount1+PurchaseOrdersMadeBetweenCount1and2-InventoryCount2=InventoryUsage Tables: 1) Inventory Counts Temp Table containing...
  11. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Honestly, looking at it, I'm not sure there is really anything I can cut out. I might be able to recode something to make it run faster, like I did for the like statements, but, for the most part, I'm just pulling data from tables and I need to pull it all. Considering the size of the...
  12. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Woops, I just realized I was looking at a single query's table scan. I have 27 queries in this... Going to go through 'em.
  13. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Cool! Holy cow, yeah. It's saying 95% of the time is the Table Scan at the end. Is there a way to make it highlight the code that that element of the execution plan comprises? Intuitively, I'd think that any time I'm doing a query I'm doing a "table scan", but based on the percentages I'm...
  14. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Sorry, that is rife with typos. I wish I could edit on this forum. I meant to say "I don't know a THING about indexes" on line 1 and **COULD'VE** on the 2nd-to-last line, not "couldn't
  15. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Honestly, 4 seconds is pretty great to me, but I'm always up for squeezing some more performance out of it. I don't know a think about indexes. ...I don't think I want to be altering the DB for this report (we have 100s of reports that pull from these tables). I have 4 temp tables with a lot...
  16. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Thanks! That knocked another 2 seconds off of my report. Down to just over 4 seconds :) Woo!
  17. SyntaxTerror

    Filter Optimization - Filtering for only #s when datatype is CHAR(30)

    Hello again :) Thanks not in small part to the assistance of you fine people, I have my 6-pages of code working. Now I'm working on optimizing it. I've knocked the run time down from 11 seconds to 6, but I know of a couple other places I could speed it up. One is with filtering inventory...
  18. SyntaxTerror

    The multi-part identifier "[alias].[field]" could not be bound

    Sure does :) I'll sort of mentally break off UPDATE and SET from the rest of the pack; FROM and everything else just determines what I'm setting and updating. Thanks again!
  19. SyntaxTerror

    The multi-part identifier "[alias].[field]" could not be bound

    Thank you! Worked like a charm. That has to do with order of evaluation, yeah? I thought I'd be able to use the alias for the SET if I declared it in the FROM, much like how you can use a table alias that you declare in the FROM where you join to refer to fields in the select. ...if that...
  20. SyntaxTerror

    The multi-part identifier "[alias].[field]" could not be bound

    SQL Server 2005 is saying that Wk1Usage.Wk1Usage in the update statement for my temp table can't be bound, but I don't see any problems with my syntax. Help? :S The subquery in the update runs flawlessly. CREATE TABLE #temp_usage ( SiteID CHAR(10), InvtID CHAR(30), Wk1Usage FLOAT...

Part and Inventory Search

Back
Top