Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>[EDIT] If you are not a programmer here is an alternative solution</strong></p> <p>Why not use the <strong>Format</strong> function in your query, e.g.</p> <pre><code>Format([ConfirmedExpires],"ww",2,1) </code></pre> <p>"ww" - specifies weeks, 2 specifies Monday as first day of the week, 1 means week 1 contains 1 Jan</p> <p>Now it is easy to do date calculations in weeks e.g. Contract expiring more than 4 weeks into the future:</p> <pre><code>Format([ConfirmedExpires],"ww",2,1)-Format(Now(),"ww",2,1))&gt;4 </code></pre> <p>Contracts expiring more than 4 weeks into the future and up to 5 weeks into the future</p> <pre><code>Format([ConfirmedExpires],"ww",2,1)-Format(Now(),"ww",2,1))&gt;4 - Format([ConfirmedExpires],"ww",2,1)-Format(Now(),"ww",2,1)),=5 </code></pre> <p><strong>Does that help?</strong></p> <hr> <p>Why don't you just use the <strong>weekday</strong> feature of functions like <strong>DateAdd</strong>?</p> <p>Instead of calculating 30 calendar days ahead you could calculate 25, or any other number of weekdays ahead.</p> <p>The code below displays a message box but you could equally use the function in a SQL query behind a message box.</p> <pre><code>Sub TestWeekDay() Dim FirstDate As Date ' Declare variables. Dim IntervalType As String Dim Number As Integer Dim Msg IntervalType = "ww" ' "ww" specifies weeks as interval. FirstDate = InputBox("Enter a date") Number = InputBox("Enter number of weekdays to add") Msg = "New date: " &amp; DateAdd(IntervalType, Number, FirstDate) MsgBox Msg End Sub </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload