access
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » Access 2003

Access 2003

The UK's most regular instructor-led training courses.
Training information: introduction access training · Microsoft access courses · Microsoft Access Training London
See also · microsoft access training · access vba courses · access database course

resolvedResolved · Low Priority · Version 2003

Access 2003

George has attended:
Access Advanced course
Access VBA course

by - delegate George [1 post] (2008 Jun 4 Wed, 16:12) replyReply

I can make a calculation of days ( In this case 'ageatdeath' by using a macro to subtract 'dateofdeath' from 'dateofbirth' - how do I make this show in days, weeks, months, years etc rather than simply in days?

Access Intermediate 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003 2008 Nov 25 Tue Bloomsbury 4 book now £207 £215
2002/XP 2008 Nov 26 Wed Tooting 0 FULL    
2003 2008 Dec 2 Tue Southwark 5 book now £198 £215
2007 2008 Dec 5 Fri Bloomsbury 4 book now £224 £224
2003 2008 Dec 9 Tue Bloomsbury 0 FULL    
2002/XP 2008 Dec 11 Thu Tooting 0 FULL    
Full Schedule: See all 55 Access Intermediate course dates.
Bookings currently available until 24th November 2009.

RE: Access 2003

by - trainer Pete platinum contributer[799 posts] (2008 Jun 7 Sat, 23:26) Edited on 2008 Jun 7 Sat, 23:34 replyReply

Hi George,

Thanks for the post, I would probably use the DateDiff rather than a Macro, although you could incorporate it into VBA code or a SQL query, here are a couple of examples, you can substitute your own field names:

In Access, the DateDiff function returns the number of time intervals between two dates.
The syntax for the DateDiff function is:
DateDiff ( interval, date1, date2[, firstdayofweek[, firstweekofyear]] )

You can use the DateDiff function to determine how many time intervals exist between two dates. For example, you can use DateDiff to calculate the number of days between an order date and its shipdate or the number of weeks between today and the end of the year.
Interval is the interval of time to use to calculate the difference between date1 and date2. The following is a list of valid interval values.

Interval Description
yyyy Year
q Quarter
m Month
y Day of year
w Weekday
ww Week
h Hour
n Minute
s Second

date1, date 2 are the two dates to calculate you want to use in the calculation.

firstdayofweek is optional argument that specifies the first day of the week. If not specified, Sunday is assumed. If not specified, the first week is assumed to be the week in which Jan 1 occurs.

Examples

DateDiff ('m', #12/17/2003#, #01/22/2004# ) returns 1
DateDiff ('yyyy', #11/05/2001#, #11/10/2003# ) returns 2

VBA Code

Dim MyNumber As Integer
MyNumber = DateDiff('d',#10/06/1998#,#12/09/1998#)

This example uses the DateDiff function to display the number of days between a given date and today. Now the MyNumber variable would contain the value of 64.

SQL query

You can also use the DateDiff function in a query.
SELECT DateDiff('d',#05/05/1985#, Now()) AS Expr1
FROM Orders

I hope you can dig something useful from this lot;
best regards Pete

RE: Access 2003

by - trainer Pete platinum contributer[799 posts] (2008 Jun 7 Sat, 23:26) Edited on 2008 Jun 7 Sat, 23:38 replyReply

Sorry pressed submit twice


Related articles

· Convert a Paper Trail to a DBMS
· Why go on a Microsoft Access Training Course?
· MS Access Top Tips: Takeaways From Microsoft Access Advanced Training
· Quick MS Access Training: Creating Custom Database Tables in 12 Simple Steps
· Microsoft Access Courses

Please browse our web site to find out more about
introduction access training and other Microsoft training courses.

Access tip:

Undo Entries In Records

To Undo any entries or changes in records:

Hit the ESC key once for the current field

And ESC twice for current record

View all Access hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information

Training Articles

AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz