Link to home
Start Free TrialLog in
Avatar of bedsingar
bedsingarFlag for United Kingdom of Great Britain and Northern Ireland

asked on

WeekEnd Date Updater

hello,

Does anybody know of a way to search for all dates in a specific column in an Access 2010 database and if they aren't a week end date (Sunday) then replace the value with the next sunday's date instead?

I'm guessing it will be a hybrid of SQL and VBA to do this?

Thanks

Josh
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Post a few exact scenarios, and the expected output for each...
Do you mean just Sunday or also Saturday?
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Update mytable set datefield = datefield + iif(weekday(datefield)=1,0, 8-weekday(daefield))
My suggestion above assumes that you take Monday as the start day of your week and Sunday as the last day of the week, and that you want to advance any non-Sunday date to the next Sunday that will occur.
Avatar of bedsingar

ASKER

Thank you all for your contributions, this solution has achieved my goal :)