troubleshooting Question

query syntax - multiply a column by 10 into another column

Avatar of al4629740
al4629740Flag for United States of America asked on
SQL
5 Comments1 Solution56 ViewsLast Modified:
I need help with query syntax in SQL.  I have the following SQL statement:

select  H.Agency,Count(distinct H.ActivityDate) as [# of days],SUM(Hours) as [Total Hours], ([Total Hours] * 10) as [Check Total], r.LastName,r.FirstName,r.BirthDate " & _
"from tblCYEPHours H inner join tblCYEPRegistrations R on H.Regid = R.RegID Where h.[Hours] > 0 and h.Agency = 'Chicago Area Project' And h.ActivityDate >= '" & DTPicker1 & "' And h.ActivityDate <= '" & DTPicker2 & "' " & _
"group by H.Agency,r.LastName,r.FirstName,r.BirthDate Order by H.Agency,r.LastName,r.FirstName

I have an error with the [Check Total] column calculation.  I am trying to multiply the [Total Hours] by 10 for the [Check Total] column.  What am I doing wrong?
ASKER CERTIFIED SOLUTION
Darrell Porter
Enterprise Business Process Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros