473,657 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning a date based on date/time criteria

5 New Member
The start of the business day is 0700. However actual times are recorded. I would like to have a field that can round to a date based on actual date/time that is entered.

I.E. If the date/time falls between 6/1 0701 and 6/2 0700 the field would return 6/2. So if the actual date/time is 6/1 03:15 the date would be 6/1, if the actual date/time was 6/1 14:25 it would return 6/2.
Jun 4 '12 #1
2 1604
Rabbit
12,516 Recognized Expert Moderator MVP
Use the IIf() function to check the time and if it's after 0700 and before 1200, add a day.
Jun 5 '12 #2
NeoPa
32,568 Recognized Expert Moderator MVP
Take the DateValue() of the original value plus #16:59:59# (which is equivalent to a day minus #7:00:00# but with a second the other way to ensure 0700 itself is not rolled over).
Jun 5 '12 #3

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

Similar topics

1
3598
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by version 2 of XSLT processor based on some condition. Q) How and where shall I write logic or import desirable XSLT on the Fly ? Q) When we call AAA.XSLT then it will be processed by XSLT Processor 1
4
5289
by: S. van Beek | last post by:
Dear reader, By a Date field with Now() as default value the content of the field is date plus time. As I need a filter in a query on date only (excluding time) I invented the following solution:
6
1673
by: Scott | last post by:
I have a start date and an end date in my project that is defaulted to the current date at run-time using the following code... Date1.Value = Now() Date2.Value = Now() I then have some code that works out the number of days between the 2 dates as follows... Dim d1, d2 As Date
0
1521
by: kumarkanth | last post by:
My question is how do I manipulate the procedure to calculate cut-off date with in working days and it should skip weekends and holidays? I have holiday table to determine holidays Table Name : HOLIDAYMSTR HOLIDAYMSTR_ID RAW(16) PREV_UPDATED_BY RAW(16) Y LAST_UPDATED_BY RAW(16) HOLIDAY_DATE DATE ...
13
29399
by: Killer42 | last post by:
Hi all. Hopefully a simple one for any SQL guru. In an Access query, how can I group by a date field, without having my data broken down by time? In other words, I just want a count per day, not per second or whatever. I'm using Access 2003, but I doubt it matters in this case. At present I am just using a function (see below) to strip off the date, but I consider this terribly inefficient. I did try some searching, but this is one...
2
2556
by: dympna | last post by:
Hi can anyone suggest a fix for this... as I am a novice in access. I have created a training table with the following fields Employee Name - joe Training Received - Fork lift Date Received - 20/6/07 Certificate - yes What I want to create is a renewal date for this training, there are
3
1873
by: wish | last post by:
Dear all; Can someone guide me how to code out the javascript to calculate the estimate date based on the user selected date and the how long the duration in term of week. eg. 19/9/2007 is select by user 1 weeks is duration also select by user ans: 26/9/2007 Thanks for ur help.
9
4137
by: trogenone | last post by:
Hello Im new to this and need a hand. Sorry if i have posted this in the wrong area. I am working on a small database it consists of two tables: Employees & Holidays Employees field are: Employee ID Auto no No duplicates Key
10
4012
by: WebCM | last post by:
There is a function: http://paste.ubuntu.com/21865 It needs GMT date in YYYY-MM-DD HH:MM:SS format - in SQL: datetime. If date is the same as today, the function returns "Today". There is one problem. This function does not recognize time zones. How to adjust date to user's time zone? Is converting to timestamp() and then to format readable to visitors the one and only solution (e.g. strtotime() + date() OR DateTime object)? Perhaps,...
4
48507
by: jtgarrison | last post by:
I apologize in advance if this has been asked for or if I'm missing somithing obvious, but I have a form that I want to auto populate the week beginning and week ending date based on the current week. I'd also like to be able to selcect (via Option Group) last week and it give me the week begin and end date. Thanks in advance. Jeff
0
8399
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.