Connecting Tech Pros Worldwide Help | Site Map

Calculating week numbers from dates in other fields

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 09:23 PM
Simon Pleasants
Guest
 
Posts: n/a
Default Calculating week numbers from dates in other fields

I recently built a database to help keep track of shipments we are
bringing into the country.

Included in the database are a number of fields with dates for
shipment, ETA etc. Each one of these is accompanied by a "week no"
relating to the week in the calendar year (I am sure many people are
familiar with working with week nos and know what I mean).

Currently the users have to refer to wall calendars which have the
week nos listed on them and manually enter it into the appropriate
field.

Is there any way in which I can have this value calculated
automatically by Access so all the user has to do is enter the date in
the date field and the week no field automatically fills itself in?
It would save us a lot of time....

Many thanks
Simon

  #2  
Old November 12th, 2005, 09:23 PM
Dean Covey
Guest
 
Posts: n/a
Default Re: Calculating week numbers from dates in other fields

I'd use this in an update query. Change the field of [Invoice Date] to
whatever you need but be sure to change it in both parts of this expression.

DateDiff("ww",DateSerial(Year([Invoice Date]),1,1),[Invoice Date],1,1)

If this is just based of todays date, that is the day you enter it then
set this as a default in your table and change the formula to

DateDiff("ww",DateSerial(Year(Date()),1,1),Date(), 1,1)

--
Dean Covey
www.coveyaccounting.com

MS-Office Certified:
http://www.microsoft.com/learning/mc...st/default.asp

"Simon Pleasants" <plesbit@hotmail.com> wrote in message
news:610080tjhmkdcgsls0us8ta18oudcd7fri@4ax.com...[color=blue]
> I recently built a database to help keep track of shipments we are
> bringing into the country.
>
> Included in the database are a number of fields with dates for
> shipment, ETA etc. Each one of these is accompanied by a "week no"
> relating to the week in the calendar year (I am sure many people are
> familiar with working with week nos and know what I mean).
>
> Currently the users have to refer to wall calendars which have the
> week nos listed on them and manually enter it into the appropriate
> field.
>
> Is there any way in which I can have this value calculated
> automatically by Access so all the user has to do is enter the date in
> the date field and the week no field automatically fills itself in?
> It would save us a lot of time....
>
> Many thanks
> Simon[/color]


  #3  
Old November 12th, 2005, 09:24 PM
Don Leverton
Guest
 
Posts: n/a
Default Re: Calculating week numbers from dates in other fields

Hi Simon,

I was looking at Stehen Lebans "Month Calendar" earlier today and noticed
that it includes weeknumbers.
http://www.lebans.com/monthcalendar.htm

If that doesn't suit you, try
Format([YourDateField], "ww")

--
HTH,
Don
=============================
Use My.Name@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

================================


"Simon Pleasants" <plesbit@hotmail.com> wrote in message
news:610080tjhmkdcgsls0us8ta18oudcd7fri@4ax.com...[color=blue]
> I recently built a database to help keep track of shipments we are
> bringing into the country.
>
> Included in the database are a number of fields with dates for
> shipment, ETA etc. Each one of these is accompanied by a "week no"
> relating to the week in the calendar year (I am sure many people are
> familiar with working with week nos and know what I mean).
>
> Currently the users have to refer to wall calendars which have the
> week nos listed on them and manually enter it into the appropriate
> field.
>
> Is there any way in which I can have this value calculated
> automatically by Access so all the user has to do is enter the date in
> the date field and the week no field automatically fills itself in?
> It would save us a lot of time....
>
> Many thanks
> Simon[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.