Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Numbers Error #16

Open
SierraKing1 opened this issue Feb 9, 2023 · 2 comments
Open

Global Numbers Error #16

SierraKing1 opened this issue Feb 9, 2023 · 2 comments

Comments

@SierraKing1
Copy link

Recieve This error when putting in the query below: "Msg 245, Level 16, State 1, Line 63
Conversion failed when converting the nvarchar value 'z' to data type int."

Select SUM(new_cases) as total_cases, SUM(cast(new_deaths as int)) as total_deaths, SUM(cast(new_deaths as int))/SUM(New_Cases)*100 as DeathPercentage
From [Portfolio Project]..CovidDeaths
--Where location like '%states%'
where continent is not null
--Group By date
order by 1,2

@IkhlasAhmad1998
Copy link

Try using this query,
Select SUM(new_cases) as total_cases, SUM(CONVERT(int, new_deaths)) as total_deaths, (SUM(CONVERT(int, new_deaths))/SUM(new_cases))*100 as DeathPercentage
From CovidDeaths
Where continent is not null

it works for me.

@Ranj8521Kumar
Copy link

I want to tackle this Issue, Please assign to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants