473,441 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

Get result based on working hours

Sl1ver
196 100+
Hi

my problem currently is that i need to get database on working hours(7am-5pm)

so lets say a order lies in the database for e.g 4 days
if i just get like timediff i will end up 96 hours where in fact it was just lying there for 28 hours

Any help will be appreciated
Oct 21 '10 #1
1 1273
ck9663
2,878 Expert 2GB
First, create a function to get the business hours in between two datetimes (the order datetime and the current datetime)

Second, do a datediff between order date and current datetime.

Then subtract the two numbers...

Good Luck!!!

~~ CK
Oct 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
14
by: niknokio | last post by:
Hi I need to be able to calculate the working time between a StartDate and an EndDate. the data is in dd/mm/yyyy hh:mm:ss format and given an 8.5 hr day (weekdays). Ive found lots of really...
9
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio...
1
by: deena22 | last post by:
hello, i'm using 'Access database' and VB 6.0. My database is named ' timesheet' and it contains a table named 'tabletimesheet'. The table contain the following fields: 'staffname, stafftype,...
3
by: Dan | last post by:
I'm trying to calculate the total work hours between a start and end date, and also working out an end date by adding a number of work hours to a start date. Can anyone recommend a decent formula...
9
by: mgrubbs | last post by:
#include <iostream> using std::cout; using std::cin; using std::endl; int main() { int code = 0; int charges = 0;
10
bsmeena7005
by: bsmeena7005 | last post by:
Hi help me to calculate the working hours between 10 to 18 hrs between two dates including the weekends also no braek or lunch time Example :- start date #01-08-2009 08:45:23# end date ...
10
by: LSGKelly | last post by:
I have some code in my database that calculates time between two date/time fields and also calculates the weekends and holidays. I did not create this code, so I'm at a bit of a loss why it's not...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.