Oct 14 2004, 06:47 AM
I'm having a bit of a thick day today, can't seem to work this out.
I've got these two fields on a form which works out the current week for this year.
I need to be able to also add the fields for the current week for last year??
???????? (result should be 13/10/2003)
???????? (result should be 19/10/2003)
I've tried using dateadd to remove the year but the days are wrong,
Any help will be greatly appreciated
Oct 14 2004, 07:21 AM
=dateadd( "yyyy",-1,Date())-Weekday(dateadd( "yyyy",-1,Date()),0)+1
Don't know if this is what you want but hopefully it helps,
Oct 14 2004, 07:30 AM
That works a treat.
Oct 14 2004, 07:40 AM
You're welcome, glad to help.
Oct 15 2004, 05:05 AM
What would be the best way to calculate the equivelant day last year to today.
ie today is friday 15th
last years equivelant friday would be the 17th
Oct 15 2004, 07:24 AM
What makes that last years equivelant to you? They don't have the same day number in the year
today is day 289
10/17/2003 is day 290
I can use vb to get those. Do you just want the friday of the week that has Oct. 15th in it? I'm sure I could modify or write something for that.
Oct 15 2004, 08:02 AM
In our company we compare sales against last years sales on a day vs day basis, not date vs date.
It's so that our sales for our busiest day saturday would never be compared to a sunday, which would
happen if we were comparing dates.
hope this makes sense
Oct 15 2004, 08:22 AM
This statement will return the same day of the week for a day supplied.
dateadd( "d",weekday(#10/14/2004# ,vbSunday)-weekday(Dateadd("yyyy",-1,#10/14/2004#),vbSunday),Dateadd("yyyy",-1,#10/14/2004#))
I think thats what you want.
Tell me if you have any problems, working out these types of issues is a lot of fun and a good learning experience for me.
Oct 18 2004, 09:08 AM
Oct 18 2004, 09:09 AM
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here