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 bkrike 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: michaela18
  • Content: Threads
  • Order by date
  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

    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...
  12. 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?
  13. 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'...
  14. 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...
  15. 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...
  16. michaela18

    Nested Selects

    I want to learn how to do nested selects, I am confused by the "(" and the commas. How do I combine all these selects into 1 so it shows on 1 result panel? Select date, Count (*) as '1_year' from callrecord where date >= '20100201' and date <= '20100224' and State in ('Process', 'Great') and...
  17. michaela18

    What would be the best way?

    I have to run a daily report, pretty manual work. I have to pull data from sql then manually enter it into excel for that day. I am trying to come up with a way to automate this process more. I try to use MS Query and just pivot the data from there but there are too many conditions to be...
  18. michaela18

    Nullif WordCount

    I have the following: Select (1+len(NULLIF(LTRIM(CodeList),''))-len(replace(NULLIF(LTRIM(CodeList),''),' ',''))) * count (*) as 'IBM_ACS' from history where order in ('In process', 'Order') and date = '20100210' and PromoCode IN ('107', 'VW109', '118') group by codelist This will count the...
  19. michaela18

    Complicated Date Query

    I have the following query: WHERE date1= '20100210' -- and date2 <= '20100212' Okay this is complicated, hard to explain. This is something i run every day, mon-fri. I want date1 to be 4 business days prior to today's date. So today is 03/01/2010 then date1 should be 02/23/2010. Tomorrow...
  20. michaela18

    SImple Query Error

    I am a beginner to SQL and I have this simple error with this select statement. I am getting an error at the From line but I put in the right name of the database. Any ideas? SELECT COUNT (CASE WHEN CODE LIKE '%123%' OR CODE LIKE '%124%' THEN CODE END) AS...

Part and Inventory Search

Back
Top