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...
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))
-...
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))...
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.
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...
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...
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...
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...
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...
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...
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...
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?
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
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'...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.