Q
Problem solve Get help with specific problems with your technologies, process and projects.

# Can the @Weekday function be manipulated for 14 days?

## A reader wants to know if the @Weekday function in Domino can be manipulated for 14 days.

Can the @Weekday function in Notes/Domino be manipulated for 14 days since it only goes to 7 days?
This is a bit difficult to answer without knowing exactly what you're trying to accomplish. However, here's an idea that I hope will be helpful.

We need to have a fixed starting point for calculating the 14-day periods, and, for it to return the value that you want, that starting point needs to be any Sunday.

Dates can be subtracted, so subtract the current day (or any date) from that start date to get the time difference in seconds. There are 86,400 seconds in a day, so to find the number of days between today and the first Sunday in the year, the formula is ([Today] – [Start Date]) / 86400.

Now you have the number of days between the current date and the start date. You can use the @Modulo function to divide up the time difference into 14-day periods and return the number of the day in a 14-day period. You'll need to add 1, because the first Sunday would return 0. So the formula would look something like this:

```tFirstSunday := [1/2/2005];
tNumDays := (@Today - tFirstSunday) / 86400;
tModulo := @Modulo(tNumDays; 14) + 1;
@Prompt([OK]; "";
"Modified @Weekday value: " + @Text(tModulo));
```

As long as the starting point is a Sunday, you'll get a return value of between 1 and 14. (You could also just use the Saturday before the Sunday start date and not need to add 1 to the result, but it's easier to understand the code if you start with a Sunday.)

Do you have comments on this Ask the Expert question and response? Let us know.

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Updated Exchange Online PowerShell module adds reliability, speed

Microsoft assists Exchange Online administrators who rely on PowerShell by reworking the underlying functionality of several ...

• ### Mammoth March Patch Tuesday lands on Windows admins

Microsoft delivers corrections for 115 unique vulnerabilities, including 26 bugs rated critical in one of its largest Patch ...

• ### Understanding Windows PowerShell function parameters

Parameters in Windows PowerShell can help admins better customize their functions, leading to improved input testing and more ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### Tech giants aim supercomputers, clouds at finding a COVID-19 cure

The new COVID-19 HPC consortium comprised of tech giants, national labs and academia are using supercomputers and clouds to speed...

• ### Top vendor SDDC certification programs for admins

If you decide to grow your knowledge of software-defined data center technologies, VMware, Nuage Networks and Microsoft offer ...

• ### Build up your knowledge of leaf-spine network technology

As organizations deal with challenges of single tree path networks, many admins are considering leaf-spine architectures. Learn ...

## SearchContentManagement

• ### Vendors offer free remote work technology for telecommuting

It's more than a marketing ploy: Cloud technology vendors, seeing their own issues enabling remote work, extend paid products to ...

• ### How businesses should deal with enterprise search issues

Enterprise search issues frequently complicate user experience with ECM systems. While users may face many problems, they also ...

• ### Box, Dropbox shore up clouds; Box-Microsoft integrations go live

Online document collaboration platforms Box and Dropbox shore up cloud bandwidth, security and customer support as remote work ...

Close