473,396 Members | 2,014 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,396 software developers and data experts.

DateDiff in query

I have a table with 5 Fields PatientID,FirstName,LastName,BalanceDue and,DueDate.I want to create a query that shows 4 catagories under 30,over 30,over 60,over 90 of balances due . I've tried using this as a sixth field as a test
field name under 30: DateDiff("d", [DueDate] ,Now()).Criteria >0 and<30. But when the parameter dialog pops up and I enter 30 and click ok the field headings show up but no data is present. I would like it to show all the patient info for all duedates 30 days or less. Any ideas on what I'm doing wrong, I'm new at access so I'm probaly doing everything wrong.
Jul 27 '06 #1
2 3021
PEB
1,418 Expert 1GB
Hi,

What is the name of your parameter? Can you give us your SQL? What type are your dates? As text or Date/Time?
Sep 6 '06 #2
MMcCarthy
14,534 Expert Mod 8TB
You have to tell the query what to put in the value of the field if the criteria is true.

Under_30: IIf((DateDiff("d", [DueDate] ,Now()) > 0) And (DateDiff("d", [DueDate] ,Now()) < 30), <What do you want to appear in the field e.g. "Yes"?>, "")


I have a table with 5 Fields PatientID,FirstName,LastName,BalanceDue and,DueDate.I want to create a query that shows 4 catagories under 30,over 30,over 60,over 90 of balances due . I've tried using this as a sixth field as a test
field name under 30: DateDiff("d", [DueDate] ,Now()).Criteria >0 and<30. But when the parameter dialog pops up and I enter 30 and click ok the field headings show up but no data is present. I would like it to show all the patient info for all duedates 30 days or less. Any ideas on what I'm doing wrong, I'm new at access so I'm probaly doing everything wrong.
Sep 6 '06 #3

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

Similar topics

1
by: intl04 | last post by:
I'm trying to set up a query that will include a new field ('Days until completion') whose value is derived from the DateDiff function. I think I have the syntax correct but am not sure. Days...
4
by: Paolo | last post by:
I am having some problem with a Year Function. I have form on which I have 4 field which indicate dates and an additional form which sums those dates: These are the fields: YEARS...
15
by: PMBragg | last post by:
Thank you in advance. I'm trying to pull all inventory items from December of the previous year back to 4 years for my accountant. I know this can be done, but I'm drawing a blank. I've tried; ...
1
by: PMBragg | last post by:
ORINGINAL Post >Thank you in advance. I'm trying to pull all inventory items from December >of the previous year back to 4 years for my accountant. I know this can be >done, but I'm drawing a...
5
by: mcbill20 | last post by:
Hello all. I have a really basic question that I hope someone has a better answer for. I apologize in advance-- I know this is probably a really basic question but I am used to Oracle rathern than...
6
by: kevinjwilson | last post by:
I am trying to get the date difference between two dates but I don't want the function to include weekends in the calculation. Does anyone have an idea on how to make this work?
1
by: Shawn Yates | last post by:
I have query which shows when employees clock in (long time) and clock out(long time). To find the total hours worked in hours and minutes I have another field on my query with the following: ...
9
by: StevoNZ | last post by:
Hi, I am a little stuck with a query I am trying to build. Attemting to calculate the delivery time for a material. I have managed to utilise the DateDiff function, but have some additional...
1
by: Sultan Ali Alhassni | last post by:
I was trying to use the datediff function in the Update query and I added the following on the upate to field : Datediff("d", , where Sentdate: is a date stored in a table called cycle_table ...
4
by: KA NMC | last post by:
I know this is very simple...but the syntax is really screwing me up...Basically what I want to do is have this query check for orders that have been open two hours and more and does not have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.