View Single Post
  #14 (permalink)  
Old 02-09-10, 20:43
myle myle is offline
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,143
Quote:
Originally Posted by Gwyar View Post
Hi Missling
I was so hoping this was going to work.. But it wants me to 'Enter Parameter Values' of Date and vbMonday
Guess I cant even copy and paste

myle
I am trying to figure this out...
Where does this go?
Code:
Function WEEKENDMON(dat) As Date
If IsNull(dat) Then Exit Function
dat = DateSerial(Year(dat), Month(dat), Day(dat))
If dat Mod 7 > 0 Then
WEEKENDMON = dat - dat Mod 7 + 9
Else
WEEKENDMON = dat+2
End If
End Function
Where does this go?
monweek:WEEKENDMON([afeilddatevalue])

And lastly, you guessed it.. where does this go?
=WEEKENDMON(Now())

Sorry to make you repeat yourself but I'm having a hard time with this one.

Thank you very much
Tracy
================
I'm using 2007.
Also looking on you tube for video lessons on functions too
haven't played with 07 yet

try this

open the msaccess file and click on MODULES click New

then paste above code into the open window close it it should ask you to save it yes

then Open a Query window put a table in there drop some feild in

where you put the feild you should be able to type

monweek:WEEKENDMON([????])

???? = a feildname from the table that is a date value

run new query if working there be a new coloum call monweek
which should have mon's date in base on the ????

praying it working

then desgin the query again and in the Where part of the query
put below the monweek feild =WEEKENDMON(Now())

run again and you should only see next monday data in the output
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
VB based on my own environment: vb6 sp5
ASP based on my own environment: 5.6
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
MYLE
Reply With Quote