You are on the right track. You need to find out what day of the week today
is first:
<CFSET Today = DayOfWeek(NOW())>
Find out how many days until Saturday:
<CFSET DaysUntilSat = 7-Today>
Add that number of days to today to get Saturday's Date:
<CFSET Saturday = DAteAdd("y",DaysUntilSat,Now())>
Add one more day to that to get Sunday's date:
<CFSET Sunday = DAteAdd("y",1,Saturday)>
To tighten that up, combine some functions to get:
<CFSET Saturday = DAteAdd("y",(7-(DayOfWeek(Now()))),Now())>
<CFSET Sunday = DAteAdd("y",1,Saturday)>
Chris Evans
[EMAIL PROTECTED]
http://www.fuseware.com
-----Original Message-----
From: Kevin Hemenway [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 04, 2000 11:00 AM
To: [EMAIL PROTECTED]
Subject: Re: Get Next Saturday command? (HOW TO?)
> >What I need to do is find "the next Saturday and Sunday". Ultimately,
this
> >will return the date for the Saturday and the date for the Sunday. I can
> >search around through the database and display things about "this
weekend".
>
> Look at the DayOfWeek, DateAdd, Datediff... functions
Welp, I looked at those, and all I could see was something complex like "get
DayofWeek, if DayofWeek = Wed, Saturday equal DayOfWeek+3." You see my brain
stem? And that just doesn't cover a Saturday being the 31st, and then Sunday
being a 1st.
I really need an example of code here. I learn best that way.
Kevin Hemenway
-- -----------------------------------------------------------------
Total Net NH, LLC EMAIL: <[EMAIL PROTECTED]>
15 Pleasant St., Suite 11 WEBSITE: <http://www.totalnetnh.net/>
Concord, NH 03301 PHONE: (603) 225-8422
--------------------------------------------------------------------
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.