dbTalk Databases Forums  

Comparing Two Dates

comp.database.ms-access comp.database.ms-access


Discuss Comparing Two Dates in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert
 
Posts: n/a

Default Comparing Two Dates - 11-05-2004 , 10:12 AM






Hello,

I'm writting a database for a dog & cat kennel, I need to know how many days
the pet has stayed at the kennel. I have two date fields named StartDate &
EndDate and have a field named TotalDays. I need this to go into a form.

Thanks

Robert
infomail at rcrawford dot biz



Reply With Quote
  #2  
Old   
Ken Snell
 
Posts: n/a

Default Re: Comparing Two Dates - 11-05-2004 , 07:45 PM






Use DateDiff function to get the number of days between the StartDate and
EndDate. You should not need to store the result in your table; just
calculate it on your form by using a textbox whose control source is an
expression similar to this:

=DateDiff("d", [StartDate], [EndDate])

--

Ken Snell
<MS ACCESS MVP>

"Robert" <infomail (AT) rcrawford (DOT) biz> wrote

Quote:
Hello,

I'm writting a database for a dog & cat kennel, I need to know how many
days
the pet has stayed at the kennel. I have two date fields named StartDate &
EndDate and have a field named TotalDays. I need this to go into a form.

Thanks

Robert
infomail at rcrawford dot biz





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.