Hello All.
having some issue with my statment and/or import.
using a statment to count the number of rows by type and then format the count of rows into a number.
Issue Im having is when i load my sql statment into excel and run my query, the count of row column comes down as a text, which i have to format into number to be able to pivot table the data. but when i refresh my query, the row count column reverts back to a text (general) format and lose the ability to use my pivot table.
is there a way to code my sql statment so the row count is allready cast as interger when i run my query in excel or is there a way in excel to keep the column format as number.
SELECT
A.AsofDate,
datename(weekday,DATEPART(weekday,AsofDate))as Weekday,
A.NAME as List,
cast(COUNT(NAME) as int)AS Listcount
FROM
[x].[dbo].[x] as A
Where
AsofDate>=DateAdd(day, DateDiff(day,0,getdate()),-30)
group by
A.AsofDate,A.NAME
order by
AsofDate asc
Bookmarks