date parameter

ChristopherL

Registered User.
Local time
Today, 06:46
Joined
Jul 2, 2013
Messages
90
Hi there!
I am having some trouble with a weekday function or something else that might help me pick a proper date as a parameter.

I want to build a function that picks yesterdays date if it's tuesday-friday, but on mondays I want it to pick the date from friday.

OR if this might be possible? (sorry I am quite a rookie at ms access)
Just pick the highest date and only use values from that date?

So what I want:

tuesday-friday = date()-1
monday = date()-3

or pick latest date reported!

Thank you for reading :)!
 
I use this..
Code:
[URL="http://www.techonthenet.com/access/functions/date/dateadd.php"]DateAdd[/URL]("d", IIf(Weekday(Date) = 2, -3, -1)
 
Think this might do aswell!
Do you know if I can do this as a parameter?
Cause the date is actually already a function (the dbo read it in as a text). So I had to do this
Code:
CurrentDate: CDate([date])

Or maybe I have to make another query with that as field?
 
Have you tried replacing the (date) in Paul's formula with CDate([date]) ?

I do hope that your field name is not date as that is an Access reserved word and will probably cause you problems in the future.

Or maybe not in Stockholm

Brian
 
Have you tried replacing the (date) in Paul's formula with CDate([date]) ?

I do hope that your field name is not date as that is an Access reserved word and will probably cause you problems in the future.

Or maybe not in Stockholm

Brian

Will try that, think it might work! Haven't got access to db atm so will try later on :)

I am not the one that created the db and named field date, some genius at my office did that :banghead: we'll see how it works out!

Thank you for your help, and how fast it was given! :)
 

Users who are viewing this thread

Back
Top Bottom