473,769 Members | 5,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating Late Date in Access

What's up Everyone?

I really need some help. I've been pulling the hair out of my head
trying to research how to calculate a late date. Here is what I'm
trying to do:
DATE VOUCHER SUBMITTED: 1 MAY 06
VOUCHER LATE?: YES
If the voucher is 5 days past the "DATE VOUCHER SUBMITTED" date, I'd
like to have it autmatically update another field named "VOUCHER LATE"
either with a yes/no answer. Is there a way to make this happen? If
there is, I should be able to query this info and create a report
right? Thanks in advance for your help.

May 13 '06 #1
32 2690
Put the following expression in a blank field in your query:
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
Set the criteria to:
=5
The query will return all vouchers that are 5 or more days late.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1175 users have come to me from the newsgroups requesting help
re******@pcdata sheet.com

"whiteboy" <be************ ****@langley.af .mil> wrote in message
news:11******** **************@ d71g2000cwd.goo glegroups.com.. . What's up Everyone?

I really need some help. I've been pulling the hair out of my head
trying to research how to calculate a late date. Here is what I'm
trying to do:
DATE VOUCHER SUBMITTED: 1 MAY 06
VOUCHER LATE?: YES
If the voucher is 5 days past the "DATE VOUCHER SUBMITTED" date, I'd
like to have it autmatically update another field named "VOUCHER LATE"
either with a yes/no answer. Is there a way to make this happen? If
there is, I should be able to query this info and create a report
right? Thanks in advance for your help.

May 13 '06 #2

"PC Datasheet" <No****@Spam.Co m> schreef in bericht news:KO******** *******@newsrea d1.news.pas.ear thlink.net...
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications 'Resource ????
Over 1175 users have come to me from the newsgroups requesting help '1175 users ????
re******@pcdata sheet.com


--
To Steve:
You have been away only for a little while
Since no-one wants your advertising/job hunting here you are allowed to stay away longer!

Over 825 !! users from the newsgroups have visited the website to read what kind of a 'resource' you are... (rapidly increasing..)

To the original poster:
Your question is also answered in the group ms.public.acces s Please don't multipost.
About Steve:
Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.
==> And he is also known here as a shameless liar with *no ethics at all.*

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
May 13 '06 #3
"whiteboy" <be************ ****@langley.af .mil> wrote in
news:11******** **************@ d71g2000cwd.goo glegroups.com:
What's up Everyone?

I really need some help. I've been pulling the hair out of my
head trying to research how to calculate a late date. Here is
what I'm trying to do:
DATE VOUCHER SUBMITTED: 1 MAY 06
VOUCHER LATE?: YES
If the voucher is 5 days past the "DATE VOUCHER SUBMITTED"
date, I'd like to have it autmatically update another field
named "VOUCHER LATE" either with a yes/no answer. Is there a
way to make this happen? If there is, I should be able to
query this info and create a report right? Thanks in advance
for your help.

As usual PC Datasheet's answer is incomplete and does not
satisfy the requirements.

Instead of what he wrote,
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
you need to embed the datediff function into an iif statement.

Create an update query. bring down the [Voucher Late] field. .

put this in the update to row.

iif(DateDiff("d ",[Date Voucher Submitted],Date()) >=5, -1,0)

(watch out for linewrap.)

--
Bob Quintal

PA is y I've altered my email address.
May 13 '06 #4
Bob,

I thought previously you indicated you were going to be polite. Is that not
part of your personality?

Steve
"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** **************@ 207.35.177.135. ..
"whiteboy" <be************ ****@langley.af .mil> wrote in
news:11******** **************@ d71g2000cwd.goo glegroups.com:
What's up Everyone?

I really need some help. I've been pulling the hair out of my
head trying to research how to calculate a late date. Here is
what I'm trying to do:
DATE VOUCHER SUBMITTED: 1 MAY 06
VOUCHER LATE?: YES
If the voucher is 5 days past the "DATE VOUCHER SUBMITTED"
date, I'd like to have it autmatically update another field
named "VOUCHER LATE" either with a yes/no answer. Is there a
way to make this happen? If there is, I should be able to
query this info and create a report right? Thanks in advance
for your help.

As usual PC Datasheet's answer is incomplete and does not
satisfy the requirements.

Instead of what he wrote,
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
you need to embed the datediff function into an iif statement.

Create an update query. bring down the [Voucher Late] field. .

put this in the update to row.

iif(DateDiff("d ",[Date Voucher Submitted],Date()) >=5, -1,0)

(watch out for linewrap.)

--
Bob Quintal

PA is y I've altered my email address.

May 14 '06 #5
PC Datasheet wrote:
Put the following expression in a blank field in your query:
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
Set the criteria to:

=5

The query will return all vouchers that are 5 or more days late.


The only thing I'd add to this is that Benjamin does NOT want to update
a field stored in a table. Although he didn't exactly say so, this is
what he imtimated when he asked to have 'it autmatically update another
field named "VOUCHER LATE" either with a yes/no answer'.

Steve's solution to use a query is the more appropriate way to do things.

The general rule of thumb is to *never* store a value that can be easily
calculated.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
May 14 '06 #6
Tim Marshall wrote:
PC Datasheet wrote:
Put the following expression in a blank field in your query:
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
Set the criteria to:

=5


Oh, I just realized - the criteria should be >=5. With just =5, the
only ones that will show up are ones that are 5 days late, 6 or more
won't show up! 8)

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
May 14 '06 #7

"Tim Marshall" <TI****@PurpleP andaChasers.Moe rtherium> schreef in bericht news:e4******** **@coranto.ucs. mun.ca...
Tim Marshall wrote:
PC Datasheet wrote:
Put the following expression in a blank field in your query:
LateDate:DateDi ff("d",[Date Voucher Submitted],Date())
Set the criteria to:

=5


Oh, I just realized - the criteria should be >=5. With just =5, the
only ones that will show up are ones that are 5 days late, 6 or more
won't show up! 8)


Tim,
Steve did say >=5 in his reply ...
However he did not meet the OP's requirements (OP wanted a yes/no output) as Bob pointed out.
But what makes Steve's answer *real* messy is the sigline!

Arno R
May 14 '06 #8
"PC Datasheet" <No****@Spam.Co m> wrote in message
news:3L******** ********@newsre ad1.news.pas.ea rthlink.net...
Bob,

I thought previously you indicated you were going to be polite. Is that
not part of your personality?

steve

From the local expert on politeness.

John... Visio MVP
May 14 '06 #9
StopThisAdverti sing wrote:
Tim,
Steve did say >=5 in his reply ...


Ah, I see. Netscrape 7.2 replaces standard > signs at the beginning of
a line with some bizarre character - I haven't figured out how to make
it not do that. Duh! 8)

My point was, despite the sig, which I agree doesn't belong here, I
think Steve correctly directed the OP to a query rather than inserting a
value into a table. OTOH, now that I think about it, such storage
could be valid if one is making records of when payments are due and
records of late/on time payments.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
May 14 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
12682
by: John | last post by:
hey all..... alright, I am frusterated to the point of throwing my machine out the window (this board went down, trying to find stuff on google, this has been a nightmare) so I hope you guys can help me with a solution. This is what I am trying to do: Pretty much, there are two dates in my database, a start date, and an end
3
2722
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to me and write in easier terms I would be very gratefull to all you access wizards! Here is my problem. I have a table with maybe 10 fields, It is used to imput information taken over the phone to solve patient problems in our Spanish...
1
2205
by: ollymr | last post by:
Hi Hope someone can help -- I'm finding this very tricky. I'm working on a school database - this school needs to pay student host families each month. The students stay with the families for different periods. In my student table I have start date and end date fields which correspond to the family stays. However, I just want the families to be paid for the current month -- the family may have had a student for as much as one year or...
10
47847
by: tkq | last post by:
I have a normal table with customer information I have a DoB field and I want to have an automatic calculation that will show the age of the customer in another field next to it called Age Could you please help me with this Thanx all
5
3531
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed to 1800 stores of a national home improvement chain store. Every week I electronicaly receive an excel spreadsheet "inventory report" with 19,800 rows or records, which I import into my tblSalesData table. The table now has 10 weeks of data or...
8
4009
by: King | last post by:
Hi I have following MS Acess query Here is the query ID Name Prgm ID Client ID Date Start Time End Time Minutes C4 Trisha TIP DEK0703 7 /7 /2006 10:00:00 AM 12:00:00 PM 120
3
1787
by: swinster | last post by:
Hi all, I have not touched access for a very long time and am attempting to help my nephew with his Video Rental Database. This is a simple three-table relationship database comprising a Video Table, Customer Table and Rental Table. We have a simple form whose source is set to the Rental Table. We want to calculate the fine on a late video using the number of days the video is late (from Rental Table) multiplied by the cost of the video...
13
2421
by: drago | last post by:
Hi guys, good to be here... I am struggling to calculated days in invoice system...Ok...The dates fields are of two kinds...One is the invoice start date and end date... The other one is the contract start date and end date...I have to calculate days of charging according to the dates involved... Suppose INVOICE start date: 01-01-07; INVOICE end date: 31-01-07 Conditions are: 1. IF the contract start date is BEFORE(<=) the invoice...
1
1485
by: bassstuf | last post by:
Ive Created a Access Data Base, and on my main table I have a field titled "Date Entered", which has the lists the date the record was created (through date() formula). What I want to do is have another field in that table that caculates the difference in days from the "date entered" column to the current date. I was using the formula: datediff("dd", , date()) I am receiving the the error of "does not recognize the field "date entered", I...
0
9423
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,...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
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
8869
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
6672
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
5298
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...
1
3956
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
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
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.