Power Pivot Table Import Wizard query issue

gjack

New Member
Joined
Mar 7, 2014
Messages
2
Excel 2010

I am writing my own query for the power pivot import wizard. I am basically doing a sum if there are records in my date range and a status = a certain value. The problem is my actual data only has dates for '01/01/2014 - 02/28/2014. If I add in and check where dates are outside of that range I am getting results back and cannot figure out why. Below is my query.
The last line of my select query should return '0's' as there are no 2013 dates but I am am getting a summary and I cannot figure out why that returns a value.

Select
[Assigned To],
SUM(IIF([Alert Date] Between '02/01/2014' And '02/28/2014' And Status = 'Not Started',1,0)) AS Month1_NS,
SUM(IIF([Alert Date] Between '02/01/2014' And '02/28/2014' And Status = 'In Progress',1,0)) AS Month1_IP,
SUM(IIF([Alert Date] Between '02/01/2014' And '02/28/2014' And Status = 'Completed',1,0)) AS Month1_C,
SUM(IIF([Alert Date] Between '02/01/2014' And '02/28/2014' And Status = 'Waiting',1,0)) AS Month1_W,
SUM(IIF([Alert Date] Between '02/01/2014' And '02/28/2014' And Status = 'ReWork',1,0)) AS Month1_RW,
SUM(IIF([Alert Date] Between '01/01/2014' And '01/31/2014' And Status = 'Not Started',1,0)) AS Month2_NS,
SUM(IIF([Alert Date] Between '01/01/2014' And '01/31/2014' And Status = 'In Progress',1,0)) AS Month2_IP,
SUM(IIF([Alert Date] Between '01/01/2014' And '01/31/2014' And Status = 'Completed',1,0)) AS Month2_C,
SUM(IIF([Alert Date] Between '01/01/2014' And '01/31/2014' And Status = 'Waiting',1,0)) AS Month2_W,
SUM(IIF([Alert Date] Between '01/01/2014' And '01/31/2014' And Status = 'ReWork',1,0)) AS Month2_RW,
SUM(IIF([Alert Date] Between '01/01/2013' And '01/31/2013' And Status = 'Completed',1,0)) AS Month3_C
From [tbl Pended]
Where [Route To] ='MCR'
Group By [Assigned To]

Thanks,
gjack
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
It looks as though the comparison being done is textual, so in an alphanumeric sort, a date like '01/02/2014' would be between '01/01/2013 and '01/31/2014' since the '02' part is less than the '31'
 
Upvote 0

Forum statistics

Threads
1,223,989
Messages
6,175,808
Members
452,670
Latest member
nogarth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top