Solved

Calculating T-90 working days date?

Posted on 2009-05-06
1
1,105 Views
Last Modified: 2012-05-06
Hi,

I have a table which holds details of business transactions. One of the fields in the table is dt_bus which is the date the business transaction occurred. Every 40 days I move transactions older than 40 days to a TRANS_ARCH table, to archive them. However, I now want to delete all transactions where dt_bus is greater the 90 working days from TRANS_ARCH (as I can retrieve these entries from tape if ever required)

How can I easly and quickly calculate the date which is 90 working days before today (ie T - 90). I don't think it's possible to include holidays so considering Mon - Fri as the working week is fine
0
Comment
Question by:bowemc
1 Comment
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 24313228
I think what you need is using dateadd function:

where yourdate < DATEADD(dd,-126,GETDATE())

assuming that 90 work days is 126 (90*7/5) calendar day.

However, you can create a calendar table including all working days and use it to find exact working day as well.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question