Spam Filter ISP Support Forum

  FAQ FAQ  Forum Search   Register Register  Login Login

SQL Date Query

 Post Reply Post Reply
Author
  Topic Search Topic Search  Topic Options Topic Options
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Online Status: Offline
Posts: 1129
  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
Newbie
Newbie


Joined: 26 January 2005
Location: United States
Online Status: Offline
Posts: 38
  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
Groupie
Groupie
Avatar

Joined: 31 May 2006
Location: Switzerland
Online Status: Offline
Posts: 92
  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
Online Status: Offline
Posts: 1129
  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

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.031 seconds.

Spam Filter ISP - Copyright © 2002-2008 LogSat Software LLC - PO BOX 916340 Longwood, FL 32791 USA

 Sales: sales@LogSat.com - Support: support@LogSat.com - Tel. (sales only): +1 407-650-3008