Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2005, 11:16 AM
Registered User
 
Join Date: Dec 2004
Location: Bodrum, Mugla, Turkey.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mustafayildirim@msn.com
Default Accounting receivable aging

I want to build aging query in MS-Access. I need your help.

Already thanks,

Pegasus
Mustafayildirim@msn.com



Pega
 
Old April 25th, 2005, 06:54 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   The way I do this is to create a text box on a form, and then make the source of the form "=Age()"

   This refers to a function that I put in a module.

   There is no reason to store this info in the database since it is always changing. Just have it displayed on a form or report when you need it.

   Here is the function code.

'=====
Function Age(varBirthDate As Variant) As Integer

    Dim varAge As Variant

If IsNull(varBirthDate) Then Age = 0: Exit Function

varAge = DateDiff("yyyy", varBirthDate, Now)

If Date < DateSerial(Year(Now), Month(varBirthDate), Day(varBirthDate)) Then
    varAge = varAge - 1
End If

Age = CInt(varAge)

End Function
'=====

HTH

mmcdonal




Similar Threads
Thread Thread Starter Forum Replies Last Post
Accounting application tsimsha ASP.NET 1.0 and 1.1 Basics 1 March 27th, 2006 11:59 PM
aging designwork Classic ASP Basics 0 December 20th, 2005 03:50 PM
Accounts receivable database dbartelt Access 3 August 3rd, 2005 02:55 PM
Building accounting receivable query mustafayildirim@msn.com Access 1 April 26th, 2005 06:45 AM
Accounting Database Lighthouse Access VBA 4 April 4th, 2004 05:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.