473,666 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to compare two date fields for num of days difference between?

1 New Member
I am using Access 2007. I have two date fields (date receievd and date complete). I need to be able to run a query and find out who is not completing their work within two days of receipt. I tried using datediff but can't figure it out. Any thoughts? I would appreciate it!

Chellie
Jul 1 '10 #1
2 5980
gershwyn
122 New Member
The syntax for DateDiff would be something like this:
Expand|Select|Wrap|Line Numbers
  1. DateDiff("d", [Date Received], [Date Complete])
  2.  
That will give you the difference between the two fields, expressed in days. Add that as a column in your query and you can set whatever criteria you want to filter the results that the query returns.
Jul 1 '10 #2
NeoPa
32,568 Recognized Expert Moderator MVP
I would suggest a WHERE clause in your query's SQL of :
Expand|Select|Wrap|Line Numbers
  1. WHERE DateDiff('d',[Date Received],[Date Completed])>2
By the way, please check the spelling of your field names. I very much hope they are not as you have posted them. Generally it is appreciated if you post your question accurately, as this can save wasted time and effort.

Welcome to Bytes!
Jul 1 '10 #3

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

Similar topics

5
8583
by: akoper | last post by:
I have a table that is a project. Each record is a task in the project. One field in each record is a date/time stamp for when that task was completed. I need to be able to: 1) compute how much time has passed between each date/time stamp and 2) compute how much time has passed between the first and last date/time stamp (total project time). This involves a self join, and I have nearly gotten it to work, but I need a little more help. ...
1
9204
by: mark | last post by:
I'm stuck: In a query I am trying to compare two fields with a date/time data type and a LongTime format to get the difference in hours (minutes and seconds if possible). After that I need to determine if the difference is greater than 5 hours. The part of the query looks like this so far (IIf(="EQ" AND (-)>5,"Yes","No") AS EQChg) but doesn't come out right. NDTIME = 10:05:02 PM STTIME = 3:01:02 PM Running a simple select statement...
4
1476
by: Yotam | last post by:
Hi, I need some help with JS. I will be grateful, if you can help me out. I have two date fields (check in, check out) and "number of days" field. I want the script to calculate automatically the difference. For example: I have defaults dates, and I want the script to put the difference in "number of days" field. And if the user will change the date, the number of days will change automatically.
3
2142
by: artifact.one | last post by:
Hi. What's the practical difference between: #include <header.h> and: #include "header.h"
8
5435
by: Claudia Fong | last post by:
Hi, In VB we have DateDiff to calculate the days difference between 2 dates, I was wondering if we have something like that in C#? I want to calculate for example the days difference betwenn 19/06/2007 and 12/06/2007.. it
8
2695
by: Tapan Bera | last post by:
Hi, I have a big problem with Date function in Excel. I need to find out the difference between two date. Suppose, one baby was born in 10th Feb 2000. What will be his age now (Yr- Month-Day). Please help.
3
7417
by: PicO | last post by:
i need some explanation about the difference between priority queue & set & heap ... as they all sort the data in ( n log n ) ... but the only i see that priority queue only can pop the top ( maximum element ) while set and heap can erase any element ...
6
8152
by: Ledmark | last post by:
Hello - I am in a class for Access 2007 Database apllication design and we are covering types of Validation rules. We have a problem that I'm trying to solve but have no idea how to go about writing it. We are building a database for a condo rental company and the rental transaction table includes an arrival date and a departure date. We need to write a table-level validation rule that indicates the departure date is seven days after the...
9
8100
by: Vinod11 | last post by:
Hi, I need to find out the difference between two dates and both the dates are provided by the user. Please can someone help me on this..Need it urgently !!! Ex: Date1 : 2007/12/26 Date2: 2007/12/24
1
3254
by: teneesh | last post by:
I have to count the difference between two dates, to determine how many days exist between them. How do I do this? Can someone guide me to a good place please? date from date to 2008-02-18 00:00:00 2008-02-29 00:00:00 - how do i count the number of 2008-03-01 00:00:00 2008-03-02 00:00:00 days in between? 2008-03-14 00:00:00 2008-03-16 00:00:00 thank you
0
8363
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8787
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8645
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7389
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...
1
6203
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5672
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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
1778
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.