Normal Topic [Solved] Next Thursday from a date. (Read 768 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
[Solved] Next Thursday from a date.
Nov 25th, 2007 at 9:43pm
Print Post Print Post  
Hi all,
I am wanting to know if i can do this, if i have a date say 26/11/2007 (New Zealand Format) and i have a drop down that has days in it it works out the date, of the day sleeted say Friday 30/11/2007.


Can anyone point me in the right direction?

Regards
Drastixnz
« Last Edit: Nov 26th, 2007 at 7:10pm by Hammer »  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Next Thursday from a date.
Reply #1 - Nov 26th, 2007 at 1:55pm
Print Post Print Post  
So, you have an element with a date in it. And you have a dropdown with the days of the week. You want to select a day of the week and have Sesame give you the date of the first occurence of that day after the date in your date element.

So, if the date element contains 26/11/2007 (Monday) and you select Wednesday from your dropdown, then you want to get 28/11/2007 as an answer.

Is the above a correct description of what you want?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Next Thursday from a date.
Reply #2 - Nov 26th, 2007 at 6:52pm
Print Post Print Post  
Thanks Hammer,

I sat down and thoughts of another way, which I think is better.  here is the code

var vDueDate as Date
vDueDate = @Calendar(Loan Date + 10, "Select Client Pay Day or press Esc to cancel")
If (vDueDate < (Loan Date + 1)) Or (vDueDate > (Loan Date + 29)) Then
{
@Msgbox(@Month$(vDueDate) + " " + @Str(@DOM(vDueDate)) + ", " + @Str(@Year(vDueDate)), "is an unacceptable date", "")
}
else
{
Week One = vDueDate
}

Thanks for the help...

(Me thinking of code now in my sleep!!!!)

Regards
DrastixNZ
  
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Next Thursday from a date.
Reply #3 - Nov 26th, 2007 at 6:58pm
Print Post Print Post  
Quote:
(Me thinking of code now in my sleep!!!!)

Oy, been there.  Unfortunately, none of my dream code translated into usable programming. Undecided
  

**
Captain Infinity
Back to top
IP Logged