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.
...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...
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...
...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...
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...
...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'...
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'...
...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...
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.