Skip to main content
Inspiring
March 7, 2007
Question

SQL question.

  • March 7, 2007
  • 1 reply
  • 206 views
I have a SQL statment that counts the time and displays the hours worked it perfect. The only problem I am haveinging is I want it to add all the hours worked into one total. Any Ideas on this?

I have tried SELECT Mar1start, Mar1end, DateDiff('n', Mar1start, Mar1end)/60 AS Hours AS Total
FROM March

but no luck.
This topic has been closed for replies.

1 reply

Inspiring
March 8, 2007
It's hard to say without knowing your table structure.
My immediate suggestion is to change your DateDiff to DATEDIFF(HOUR,
Mar1start, Mar1End) and drop the division.


"lands1ide" <webforumsuser@macromedia.com> wrote in message
news:esngk9$llp$1@forums.macromedia.com...
>I have a SQL statment that counts the time and displays the hours worked it
> perfect. The only problem I am haveinging is I want it to add all the
> hours
> worked into one total. Any Ideas on this?
>
> I have tried SELECT Mar1start, Mar1end, DateDiff('n', Mar1start,
> Mar1end)/60
> AS Hours AS Total
> FROM March
>
> but no luck.
>
> SELECT Mar1start, Mar1end, DateDiff('n', Mar1start, Mar1end)/60 AS Hours
> FROM March
>