Problems with “DateAddâ€

C

cage4000

Hi all,

I am trying to subtract one Weekday from [SchedDC] which is a Date field
(dd/mm/yy), but it will only subtract 1 day in general, it will not remove
the weekends. Can you tell me what I’m doing wrong?

DateAdd("w",-1,[SchedDC])

Thanks,

Cage
 
J

Jerry Whittle

My second ugly attempt today. W for weekday just doesn't do what you would
expect.

IIf(Weekday(DateAdd("d",-1,Date))=7,DateAdd("d",-2,Date),IIf(Weekday(DateAdd("d",-1,Date))=1,DateAdd("d",-3,Date),DateAdd("d",-1,Date)))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top