Remove weekend from result of query

Remove weekend from result of query

  
Hi,

It is possible to remove the day (Saturday and Sunday) on the result of advanced query?
My advanced query..
SELECT COUNT(DISTINCT{TIME_POST}.[PostingDate])
FROM {TIME_POST}
WHERE (Month({TIME_POST}.[PostingDate]) =  @Month)
    AND ({TIME_POST}.[UserMasterId] =  @UserMasterId)
    AND ({TIME_POST}.[StatusId] = @StatusId OR {TIME_POST}.[StatusId] = @StatusId2)

 Thanks
Hi Vítor,

You can use DATEPART to retrieve the weekday of your date. Check the Microsoft documentation here

Hope this helps yous.

Cheers,
André
Hi André,

already works...

Thanks


hi Vitor,


Some examples for doing thy Advanced Query

SELECT DATEPART(year, '2007-06-01') AS "Year",
    DATEPART(month, '2007-06-01') AS "Month",
    DATEPART(day, '2007-06-01') AS "Day",
    DATEPART(dayofyear, '2007-06-01') AS "DayofYear",
    DATEPART(weekday, '2007-06-01') AS "Weekday";

Regards,

DM