ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 20th, 2003, 07:44 AM
jsaunders jsaunders is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 jsaunders User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Between days of the week query

My current query shows events entered into an intranet calendar app. Now it shows
PHP Code:
"SELECT * FROM tEvents WHERE Start_Date BETWEEN Now() AND Now()+7 " "ORDER BY Start_Date " 

What I want it to do, is show from Sunday to Saturday each week. Is there a way to query that? This is from ASP to an Access Database.

Reply With Quote
  #2  
Old October 20th, 2003, 06:31 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Check out ASP's weekday function. It returns the "postion" of the day of the week that any given date falls on.

So, to find the PREVIOUS Sunday, use this little function. It minuses a day off the given date until it finds Sunday. To find the NEXT occuring day, change the number value in the dateadd function to a postive.

Code:
do until weekday(dDate) = 1
    dDate = dateadd("d", -1, dDate)
loop

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Between days of the week query


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap