473,322 Members | 1,526 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,322 software developers and data experts.

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

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 5962
gershwyn
122 100+
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,556 Expert Mod 16PB
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
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...
1
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...
4
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...
3
by: artifact.one | last post by:
Hi. What's the practical difference between: #include <header.h> and: #include "header.h"
8
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...
8
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)....
3
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 (...
6
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...
9
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:...
1
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 ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.