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 Wanet Telecoms Ltd 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

    ...line.id, line.description, SUM( sales.volume) AS Volumn, SUM(sales.Sales)AS Sales, CONCAT((SUM(Sales.sales)/SUM(sales.volumn))*100,'%') AS ATC, CONCAT(vz.goal,'%') AS Goal FROM sales_daily sales,line_items line, line_Info VZ WHERE sales.io_id = line.io_id AND sales.io_id = VZ.id AND...
  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

    ...thursday begin set @StartDate=dateadd(day,1,@StartDate) set @importdate=@StartDate set @DateDiff=@DateDiff-1 insert into @TempOBRMasterData select *,OBR_10_bundle+OBR_Blackberry as 'Total' from Fn_GetOBRMasterDataByimportdate(@importdate,@ActualDate) end else begin if @rtDayofWeek=6 --Frieday...
  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

    ...the promotion code but I get different numbers. The first query I run is Select month(a.calldate), a.callvendorcode, a.promotioncode, count(*) 'AFGA' from history.dbo.historyrecords a, Type.dbo.TypeRecords b where a.recordid= b.recordid and a.calldate between '20100201' and '20100228'...
  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

    ...between '20100210' and '20100228' AND OrderStat IN ('OKAY', 'GOOD) AND OfferCode IN ('105', '199', '122') select IBM_BPLAN = (select count(*) from history a, Package.dbo.PackageType b where a.LeadRecordID = b.LeadRecordID and a.MailDate = '20100210' --and calldate >= '20100220' and...
  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