Solved

How do i exclude weekend days in a query ?

Posted on 2008-06-23
1
960 Views
Last Modified: 2009-08-18
I'm using the query below, which works fine, now i want to take it one stpe further and exclude all weekends....

SELECT  a.number,
        a.contact_name,
        a.category,
        b.subcategory,
        a.brief_description,
        a.open_time,
        a.assignment,
        a.status,
        b.problem_status,
        b.ticket_owner
FROM    probsummarym1 a
        INNER JOIN probsummarym3 b ON a.number = b.number
WHERE   datediff(d, open_time, GETDATE()) > 3
        AND b.problem_status <> 'Closed'
ORDER BY a.assignment
0
Comment
Question by:basile
1 Comment
 
LVL 31

Accepted Solution

by:
James Murrell earned 500 total points
ID: 21850714
Hello basile,

http://www.dbforums.com/showthread.php?t=515739

Regards,

cs97jjm3
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS troubles 4 21
Trouble analysing a database 9 15
TSQL - How to perform an IF… SELECT? 2 12
Error is query 14 0
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now