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: *

  • Users: jtrembla
  • Order by date
  1. jtrembla

    Schema Question

    A smart programmer, lol.
  2. jtrembla

    Schema Question

    I currently have one table to hold ForecastAdjustmentTypes Now each forecast adjustment are recorded differently. Thus, attached to different schema. For example some adjustments are done at the population level and some are done at the drug level. Is it best practice to keep the type names...
  3. jtrembla

    Help with combining 2 query and make subquery

    it is fast. I am trying to be anal about indexes and normalization. I broke one normalization rule. We have drugs that can added as an emerging drug, but they are added 3 different ways... Emerging brand Emerging Brand from Existing Brand Emerging Generic from Either EmergingBrand or...
  4. jtrembla

    Best way to handle pivot data that gets updated..

    Our company wants to view data from a normalized table in a pivoted grid. Not only that, they need to be able to update the values as well. Thus, I created a pivoted stored procedure which uses dynamic sql b/c the crap pivoted function doesn't read the column values. Now updating the grid in...
  5. jtrembla

    Help with combining 2 query and make subquery

    it did. Any recommendations on make my query better, readable etc.? I am new to this thus want to make sure the next person who reads this won't pull his hair, lol.
  6. jtrembla

    Help with combining 2 query and make subquery

    no it can have more than one record, so my result will be like Pricing drug groupid Geographyname adjustment value 1 usa null 2 france .58 3 uk null This is what I came...
  7. jtrembla

    Help with combining 2 query and make subquery

    Yep, query 2 has a field called Adjustment value, the table ForecastAdjustment has fields PricingDrugGroupId and ForecastPeriodTimelineID. My Final results need to be Pricingdruggroupid ForecastPeriodtimelineid, Pricingdrugname, Geographyname, PeriodTimelineDate AdjustmentValue (from...
  8. jtrembla

    Help with combining 2 query and make subquery

    Query 1 (I want all the results and only matching results from query 2) They will be joined on PricingDrugGroupID and ForecastPeriodTimelineID eventhough query 2 does not return these columns it is in the table. Query 1 code... SELECT dbo.PricingDrugGroup.PricingDrugGroupID...
  9. jtrembla

    Comments in Stored Proc getting removed...?

    My comments are getting replaced by system commment? How do I override this? Is it a template or something? /****** Object: StoredProcedure [MarketForecaster].[Population_SelectByVersionID] Script Date: 12/16/2008 14:53:12 ******/
  10. jtrembla

    Query - Filter out records based on criteria

    bborissov, your code does not work. There seems to be an error with this... ON YourTable.DrugId = Tbl1.DrugId YourTable.Country = Tbl1.Country
  11. jtrembla

    Query - Filter out records based on criteria

    Yes, and thanks all, I am learning rather quickly because of this forum. You guys save lots of time.
  12. jtrembla

    Query - Filter out records based on criteria

    Does this also work? SELECT PricingDrugID, BrandGeneric, Country FROM Table1 WHERE (((Table1.PricingDrugID) Not In (select PricingDrugID FROm Table1 where BrandGeneric = 'generic'))) OR (((Table1.Country) Not In (select Country FROm Table1 where BrandGeneric = 'generic'))) It seems to return...
  13. jtrembla

    Query - Filter out records based on criteria

    Here is my table DrugId | BrandGeneric | Coutnry ============================================= 1 brand US 1 brand France 1 generic US 1 generic France 1...
  14. jtrembla

    Help with Query

    I am having a tough time on where to begin with this... PricingDrugGroupID | PricingDrugName | Country | BrandGeneric =========================================================================== 1 PricingDrug A USA BRAND 2...
  15. jtrembla

    Calculated fields from another calculated field??

    thanks, it just seems like a simple update to the t-sql language to allow this. I mean if MS Access allows this, then t-sql certainly can, repeating the columns in calculations can be quite annoying and long, especially when I have like 5 calculated columns referencing other calculated columns...
  16. jtrembla

    Calculated fields from another calculated field??

    In MS Access you can reference a calculated fields by the alias name: example: SELECT [sales]/[unit] AS UnitSales, [UnitSales]-1 AS UnitSalesLessOne FROM Table1; Can this be done in t-sql, I get an invalid field name error? If not then that is crappooo
  17. jtrembla

    Should I normalize

    well I am concerned I am introducing more joins than necessary. At max I will only have 12 models. I think a full normalization would consist of 5 tables. All erosion models are year based and only last for the first 4 years. Should I break out the time info into a separate table to account...
  18. jtrembla

    Should I normalize

    thanks everyone. Points well taken. So my final tables would be this. ErosionModel ------------ ErosionModelID ErosionName ErosionRate (should i have a seperate table for slow, medium, fast values?) Geography ---------- GeographyID GeographyName GeographyErosionModel --------------------...
  19. jtrembla

    Should I normalize

    I have the following data, and I was wondering if I should create a ErosionRateType and ErosionModel (with name and rate type) table or just leave the data as is since we are only going to have 3 erosion models at max. Btwm geography is an id field to the geography table. Example data...
  20. jtrembla

    Cascade Delete

    So my guess is I need to add a trigger to delete the records, and remove the constraint?

Part and Inventory Search

Back
Top