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

  1. michaela18

    Take the Min Value

    Hi, I was wondering if anyone knows how to do this. I have the follow fields in a table: Date G_id Gz_id Owner_id Views Sales I want to pull by Owner_id, all the sales by date, but only the Minimum Views by date by G_Id and then GZ_ID For example: On 01/01/2011, there are 2 records, both...
  2. michaela18

    Min sub query questions, need help

    I have the following query: SELECT SA.name AS 'Name' , IF(budget.pricing_convention LIKE '%ABC%', ROUND((IFNULL((budget.budget/(budget.unit_price)),budget.bonus_units)) - SUM(VWZ.impressions),0), ROUND((IFNULL((budget.Goal/(budget.unit_price/1000)),budget.bonus_units)) -...
  3. michaela18

    Min/least function layering in question

    I have the following query: SELECT io.name AS 'IO Name' , IF(budget.pricing_convention LIKE '%ABC%', ROUND((IFNULL((budget.budget/(budget.unit_price)),budget.bonus_units)) - SUM(VWZ.impressions),0), ROUND((IFNULL((budget.Goal/(budget.unit_price/1000)),budget.bonus_units))...
  4. michaela18

    Case statement help

    How can I write a case statement for: nullif(CONCAT((SUM(Sales.sales)/SUM(sales.volumn))*100,'%'),0) AS ATC ? I want to pull 'ATC' but with different where statements. But I don't know how to put that as a case statement like nullif ( case when ???? I have no idea.
  5. michaela18

    Combining Queries

    How can I combine these 2 queries? They're basically the same, just one takes the past 7 days and the other takes the past 1 day. Is there a way to do the first 7 days? There is a field in VZ table that has Start_Date. How can I write that? Like VZ.start_date + 7? SELECT VZ.name,Sales.io_id...
  6. michaela18

    Tier Report

    I have 2 tables, Traffic, Site I want the campaign_name,website_views, website_clicks from the Traffic table and the site_name from the site table where traffic_site_id=site.id I want to seaparte the data by Tiers of website_views. Like how many views does it take for the site_name to reach...
  7. michaela18

    Help with combining 2 Query to 1 table

    I want to combine these 2 queries into 1 table that looks like Month 1st 7 in month Line Code Views Sales Views Sales SELECT GA.Line_code, GA.Views, GA.sales, i.description FROM GA_sales_table GA, I_description_table I WHERE GA.Line_code = i.id AND i.description NOT...
  8. michaela18

    Procedure help

    I have the following declare @ActualDate datetime declare @importdate datetime declare @DateDiff int set @DateDiff=datediff(day,@StartDate,@EndDate) DECLARE @rtDayofWeek VARCHAR(10) set @DateDiff=@DateDiff+1 while @DateDiff>0 begin set @ActualDate=@StartDate set @rtDayofWeek...
  9. michaela18

    Sumproduct Multiple files

    How can I sumproduct across multiple files? Currently I have it set up to update links to other template files. So my process is pretty lengthy in this way. I would take each file everyday and rename them and then put them in a folder and then my master template file updates the values based on...
  10. michaela18

    Date Query Help

    I want to be able to run a query for an entire month but the date is really confusing as to how I would write this query. Originally I wanted to write it as: select maildate, COUNT (CASE WHEN CodeList LIKE '%23412%' OR CodeList LIKE '%12341%' THEN 1...
  11. michaela18

    Very Weird Results

    Why would it get different results though if I am filtering the same promotion codes in the data as oppose to it being already filtered?
  12. michaela18

    Very Weird Results

    If I run the same queries i get different results. The first query I dont specified the promotioncode, I just filter the results in excel to the promotioncode I want. The second query I specify the promotion code but I get different numbers. The first query I run is Select...
  13. michaela18

    Excel Average Help

    I want to average a range a2:AC2 Some cells have text, blanks, and dates. I want to only average the cells with numbers in them > 0. When I do this it will also average the date values also. How can i exclude this?
  14. michaela18

    Select multiple columns Help

    When I do that: select vendorcode, orderdate, deliverdate group by vendorcode, orderdate, deliverdate it would give me those columns but not wit the dates i specified
  15. michaela18

    Select multiple columns Help

    I have the following query which just pulls in the VendorCode. But is it possible to also display the orderdate and Deliverdate. As you can see I have 2 different dates. Please help. Thanks select VendorCode, count(case when Orderdate = '20100203' and Rush = 'N' and package IN ('ABVX107'...
  16. michaela18

    Trouble with Combining Selects with Joined tables

    how would one set up this procedure? something like: create procedure @startdate datetime @enddate datetime CODE HERE?
  17. michaela18

    Trouble with Combining Selects with Joined tables

    If I create a procedure then can I change it since I have to run it daily so the date will always change?
  18. michaela18

    Trouble with Combining Selects with Joined tables

    Well I want to case them because I want my results all in 1 result pane so then I can simply copy and paste it into excel and do vlookups
  19. michaela18

    Trouble with Combining Selects with Joined tables

    I am trying to fit all queries into 1 query but I am getting stuck. I have trouble with the Case and joining tables. I am trying to get this query Select COUNT (CASE WHEN CODEID LIKE '%545456%' OR CODEID LIKE '%878974%' THEN CODEID END) AS 'IBM_5_bundle' FROM history...
  20. michaela18

    Multiple Words in 1 record splitted

    I have a field called Phonecodes and it would show what phones people brought, but it will show all the phones. So the field look something like this: Phonecodes Samsung Motorola Apple It's sepparated by spaces. I have a query that pulls up the date, phonecode, keyID, and Pricecode Is there...

Part and Inventory Search

Back
Top