Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

SQL help needed


  • Please log in to reply

#1
robert macnair

robert macnair

    New Member

  • Member
  • Pip
  • 1 posts
Hi guys,

im new to this forum and just a quick question to ask

Im trying to create a report of the maount of overtime certain employees have done using data from a database.

When the employee enters their overtime, they enter the information in minutes. For the report i will need to see the imformation in hours so the correct overtime pay can be sorted. Im trying to enter an expression into the field that has the data recorded which will allow me to convert minutes to hours.

At present i have this (i know its not a valid SQL expression but you can get the idea of what im trying to do with it). i Just need this converted into a valid expression to put into Reporting Services

= (time_worked) / 60 AS time_worked_hours 'This will get the hours, but how do i get rid of decimals without rounding????'

&

":" - to put in between the hours and minutes

&

(time_worked) / 60

ROUND (time_worked, 2) AS time_worked_hours_mins

=SUM (time_worked_hours_mins) - (time_worked_hours) AS time_min - this will get the mins (as a fraction of 100)

(time_worked_mins) * 60 - to turn the fraction out of 100 into the number of minutes in an hour

hope i gave enough information as to what im trying to do, btw if theres an easier way please do tell.

Cheers in advanced

Robert Macnair
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP