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

• ### How to fortify your virtualized Active Directory design

It takes a little work to fine-tune your Active Directory deployment, but the benefits will result in little to no service ...

• ### February Patch Tuesday resolves IE zero-day

Microsoft released security updates for 99 unique vulnerabilities, including an Internet Explorer flaw the company had notified ...

• ### What's new with PowerShell error handling?

PowerShell 7 introduces a new cmdlet to assist administrators who wanted a better way to find out what broke in the scripts they ...

## 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

• ### Learn the main Linux OS components

Linux is one operating choice to run on your infrastructure. Get started with these terms to discover how the OS works and how it...

• ### New Dell EMC PowerEdge servers are built for the rugged edge

New Dell Streaming Media Platform includes two small form factor PowerEdge servers and a Modular Data Center. Dell aims the ...

• ### Initiative aims to improve data center incident reporting

The Data Center Incident Reporting Network hopes to pull back the smoke screen on software and hardware issues to improve ...

## SearchContentManagement

• ### Test yourself on the differences between SharePoint and OneDrive

Businesses use Microsoft SharePoint and OneDrive capabilities for a number of reasons. Test your knowledge on the differences ...

• ### Akeneo rolls out newest version of PIM software

Akeneo PIM version 4.0 features digital asset manager, API-integrated connection modules and AI attribute mapping to better ...

• ### Get to know 4 workflow automation tools

Workflow automation can benefit businesses by making manual processes digital, giving employees more time to work on other tasks....

Close