473,479 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need to round up a timestamp value if it occures within a specific time.

1 New Member
I have the need to look at a time stamp within a Access record and if that timestamp occures within a specified time frame, I want to rounded up the time to the start of the next business day, if not return the original time stamp.
Sep 24 '10 #1
1 1875
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Can't answer this one in detail, as you have not provided much to go on, but I can at least give some pointers as to how to approach it.

Date/Time values in the Office applications have two parts; a long-int whole-number component representing the date, and a fractional component representing the time, where 0 is midnight and 0.5 mid-day and so on.

You need to check whether or not the date/time value is between the start and end times that you are interested in. This can be a little more involved than you might realise, as date-time values are numbers represented in text form in a very different way.

If the date/time value is within the range you are interested in, you'll need to add one or more to the whole number (date) component of the timestamp to take it to the next business day, truncating it using Int or somesuch to zero the time value. How much you need to add depends on when the next business day is, and that in turn depends on whether it is currently, say, Friday and the next business day is Monday. You can use the Weekday function to find out what the day number for the current day is.

Functions which may help: DateDiff and DateAdd, which can work with or return differences expressed in seconds, hours, minutes, days, weeks, months, quarters, and years; WeekDay, which returns a numeric value representing the day of the week; Date(), which the returns the current date; Now(), which returns the current date and time.

-Stewart
Sep 25 '10 #2

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

Similar topics

10
24444
by: Andreas | last post by:
Hi! Is it possible to get a time event at a specific time, for instance eight a'clock? My program is running in the background and is minimized to the tray bar. If not, is there a smooth way...
5
45599
by: Jeong-Gun Lee | last post by:
I'm writing a code of writing a value to a specific memory address. ================================================================= #include <stdio.h> int main() { long air; long...
1
2271
by: A.Neves | last post by:
Hi, I have a DateTime in an Access database where I store one Date dd-mm-yyyy and a specific time HH:mm of the day for that date. How can I change the time without chaging the date and vice...
5
5153
by: Soeren Gerlach | last post by:
Hello, I've an integer column in a certain table that I need to convert into a timestamp value to finally get a day difference to the current date. >From the manual it looks like straight...
3
13465
by: startsmart | last post by:
Hi This is first time to write and alse it is first time to show this site my problem is i need to pass value from any input type like text for example to hidden field I tried to make a...
19
107847
Frinavale
by: Frinavale | last post by:
Filtering user input is extremely important for web programming. If input is left unfiltered users can input malicious code that can cripple your website. This article will explain how to make...
1
2716
by: poopsy | last post by:
how do i round a value to the nearest integer?
5
4822
by: Henry J. | last post by:
I know this could be a dumb question, I just want to confirm that it is faster to execute inserts, if a timestamp field is set to have a default value, like DEFAULT CURRENT TIMESTAMP, and skip that...
2
3222
by: bharathreddy | last post by:
This is insight I would like to share how to restrict application from doing some tasks on specific time in specific timezone. Like if we want to restrict our application to work only from...
1
4172
by: colintis | last post by:
Hi guys, I'm actually doing this from Access, which requires to connect to an excel worksheet, then calculate the average number of that day within a specific time. For testing purpose I put the...
0
7019
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
7067
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
6847
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
5312
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
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
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...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.