Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

Query Syntax

I need to query a field(Hours) in my DB that has numeric values in each entry,  However, I am not sure how to add up all of the numbers that are returned by the query?  Can someone please point me to the correct tutorial or offer an example?
Avatar of mnasr333
mnasr333

Typical Date Query
How to query a table with a selection on a datetime column, for example, find all items for the date 2006-01-14. This isn’t really a script, but it is one of the most common questions about datetime.

Select
      *
from
      NyTable
Where
      MyDateColumn >=  '20060114' and
      MyDateColumn <   '20060115'
ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of awking00
See attached.
comments.txt
@awking00:  It's easier for us to use the site if we have more information in clear text instead of in attached files.

<quote>
What is the data type of the Hours field? Are you looking for a sum of all the hours in the table or a sum for a given set of records? If the first, RajkumarGS gave you the answer. If the second, you will need to do a group by. For example, if you wanted the total hours worked by each employee, you would select employee_id, count(*) from table group by employee_id. Perhaps some sample data and the expected results might better clarify your issue.
</quote>

Regarding the last sentence, I could not agree more!
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_7830-A-Quick-Tour-of-Test-Driven-Development.html
Ray_Paseur,
Beleive me, if I could do that, I would. All too frequently attachments are the only way my responses will go through. I tried to initially respond in clear context and I apologize for any inconvenience. I can only say that it is extremely inconvenient for me to have to respond in this way.
Wonder why that is -- I see a comment form and it's for me to type responses into the form.  Have you told EE about the issue?
When EE upgraded their site (it's been, what, about 2 years ago), I started having the problem and mentioned it a number of times, but there seemed to be no solution. It seems the problem may be with my extremely restrictive firewall.
10-4.  I have no firewall.  Maybe there is a way to tell your firewall to whitelist the domain?