473,507 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

week number

The following returns the week numbers perfectly:

Week Number: DateDiff("ww",DateAdd("ww",-20,[Intake Day]),[TheDate])
= 0,1,2,3, ...20
what I would like is to have :

-1, -2, -3 ...-20

I am not sure how to acheive this.

Nov 13 '05 #1
3 1651
>Week Number: DateDiff("ww",DateAdd("ww",-20,[Intake Day]),[TheDate])

Try reversing the parameters in DateDiff
DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))

--
Wayne Morgan
Microsoft Access MVP
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:ch**********@news7.svr.pol.co.uk...
The following returns the week numbers perfectly:

Week Number: DateDiff("ww",DateAdd("ww",-20,[Intake Day]),[TheDate])
= 0,1,2,3, ...20
what I would like is to have :

-1, -2, -3 ...-20

I am not sure how to acheive this.

Nov 13 '05 #2
Wayne Morgan wrote:
Week Number: DateDiff("ww",DateAdd("ww",-20,[Intake Day]),[TheDate])

Try reversing the parameters in DateDiff
DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))


or *-1? :-)

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #3
The solution turned out to be :
Week Number: DateDiff("ww",DateAdd("ww",1,[Intake Day]),[TheDate])

Thanks for the assistance anyway.
regards
Peter

"Trevor Best" <nospam@localhost> wrote in message
news:41***********************@auth.uk.news.easyne t.net...
Wayne Morgan wrote:
Week Number: DateDiff("ww",DateAdd("ww",-20,[Intake Day]),[TheDate])

Try reversing the parameters in DateDiff
DateDiff("ww", [TheDate], DateAdd("ww", -20, [Intake Day]))


or *-1? :-)

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #4

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

Similar topics

2
5200
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
5
3286
by: Bullschmidt | last post by:
If I know the week number and the year, how can I calc the beginning and ending dates of the week? For background I'm going to do some grouping by week but don't just want to call the weeks Week...
7
15137
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code...
5
3023
by: Peter Bailey | last post by:
I have a query that returns , and : 12/05/04 3 Wednesday 13/05/04 0 Thursday and so on what I would like to do now is count the number of bookings by week so from monday to...
9
3398
by: Ray | last post by:
I need to convert the normal calendar to show the week no., the period no. and the financial year. The financial year format is as follows:- Date start: 2 May, 2005 7 days a week, 4 weeks a...
2
34326
by: Rustan | last post by:
Hi Im using GregorianCalendar to find out the current years week numbers. When the user chooses a week number in a dropdown i want to show that week in a table with the corresponding dates. For...
3
17309
by: Mal | last post by:
Hello, Any advice on a function to convert a given week number to a date? Ideally I'd like the first day of that week. I'm using this to compare year to year....using the week number as the...
18
1969
by: Jen | last post by:
Is it possible (how) to display a new record every week (or day) from a recordset?
6
25348
by: aarklon | last post by:
Hi folks, I found an algorithm for calculating the day of the week here:- http://www.faqs.org/faqs/calendars/faq/part1/index.html in the section titled 2.5 what day of the week was 2 august...
4
10814
by: Vince | last post by:
Given a week Number, how do I calculate the date that for the Monday of that week?
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7031
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...
0
7485
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...
0
5623
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,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
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 ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.