Print Page | Close Window

SQL Date Query

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=6228
Printed Date: 23 November 2025 at 2:14pm


Topic: SQL Date Query
Posted By: Desperado
Subject: SQL Date Query
Date Posted: 05 September 2007 at 11:06am
Anyone know the SQL Syntax for Monday through Friday but NOT Saturday and Sunday?

-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com




Replies:
Posted By: Derk
Date Posted: 05 September 2007 at 2:11pm
this example is probably close to what you want:

http://www.plus2net.com/sql_tutorial/date-dayofweek.php - http://www.plus2net.com/sql_tutorial/date-dayofweek.php


Posted By: atifghaffar
Date Posted: 05 September 2007 at 4:22pm
Desperado,

For Mysql it would be dayofweek.
Sunday=1, .....  Saturday=7;

Example: Show number of quarantine by dayof week
select dayofweek(msgdate) as d, count(*)   from tblquarantine group by d;

Example: show number of quarantine by dayof week but not saturday and sunday.
 select dayofweek(msgdate) as d, count(*)   from tblquarantine group by d having d>1 and d<7;





-------------
best regards

Atif


Posted By: Desperado
Date Posted: 05 September 2007 at 5:04pm
Thanks to both ... I will give it a shot!

-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com




Print Page | Close Window