Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - SQL Date Query
  FAQ FAQ  Forum Search   Register Register  Login Login

SQL Date Query

 Post Reply Post Reply
Author
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post Topic: SQL Date Query
    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

Back to Top
Derk View Drop Down
Groupie
Groupie


Joined: 26 January 2005
Location: United States
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote Derk Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
atifghaffar View Drop Down
Senior Member
Senior Member
Avatar

Joined: 31 May 2006
Location: Switzerland
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote atifghaffar Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.