|
 |
asp_databases thread: interesting problem
Message #1 by imran.saleem@b... on Wed, 23 Jan 2002 14:01:38
|
|
Hi,
i have a slight problem, i have a page with several links. Each of
these links, when selected, dynamically create a a form that displays 7
text boxes for each of the days in the week. Thus the first link displays
7 text boxes for the next 7 days, the second link displays 7 text boxes
for the next 7 days after and so on. Beside each text box i have a label
that displays the date for that particular text box. For example;
Wed 23 Jan <Text Box>
Wed 24 Jan <Text Box>
Wed 25 Jan <Text Box>
..
...
etc
Currently when i click on the first link i am only able to display text
boxes for the next 7 days starting from todays date. However i want to be
able to display text boxes from the first monday of the week for each
link. For example when i click on the first link even though today is
wednesday i want Monday and Tuesday`s text boxes being displayed instead
of just todays and then text boxes for the remaining week. When i click on
the second link i want to be able to display next weeks text boxes
beginning from monday and so on.
Any ideas would be really appreciated.
Message #2 by "Sloan Thrasher" <cst2000@a...> on Wed, 23 Jan 2002 09:34:52 -0500
|
|
Take a look at the weekday function. It returns the current day of the week
as a number. So you can force a date to a particular day of the week. For
example, to return the most recent Monday from a date:
Function GetMonday( DateToCheck )
Dim DOW
DOW = WeekDay(DateToCheck, vbMonday)
' DOW now contains 1-7, with 1 = Monday
' So the most recent Monday occured 1-DOW days ago
GetMonday = DateAdd("d", (1 - DOW),DateToCheck)
End Function
<imran.saleem@b...> wrote in message news:138666@a..._databases...
>
> Hi,
> i have a slight problem, i have a page with several links. Each of
> these links, when selected, dynamically create a a form that displays 7
> text boxes for each of the days in the week. Thus the first link displays
> 7 text boxes for the next 7 days, the second link displays 7 text boxes
> for the next 7 days after and so on. Beside each text box i have a label
> that displays the date for that particular text box. For example;
>
> Wed 23 Jan <Text Box>
> Wed 24 Jan <Text Box>
> Wed 25 Jan <Text Box>
> ..
> ...
> etc
>
> Currently when i click on the first link i am only able to display text
> boxes for the next 7 days starting from todays date. However i want to be
> able to display text boxes from the first monday of the week for each
> link. For example when i click on the first link even though today is
> wednesday i want Monday and Tuesday`s text boxes being displayed instead
> of just todays and then text boxes for the remaining week. When i click on
> the second link i want to be able to display next weeks text boxes
> beginning from monday and so on.
>
> Any ideas would be really appreciated.
>
>
Message #3 by imran.saleem@b... on Wed, 23 Jan 2002 14:39:12 -0000
|
|
thanks Sloan.
-----Original Message-----
From: Sloan Thrasher [mailto:cst2000@a...]
Sent: Wednesday, January 23, 2002 2:35 PM
To: ASP Databases
Subject: [asp_databases] Re: interesting problem
Take a look at the weekday function. It returns the current day of the week
as a number. So you can force a date to a particular day of the week. For
example, to return the most recent Monday from a date:
Function GetMonday( DateToCheck )
Dim DOW
DOW = WeekDay(DateToCheck, vbMonday)
' DOW now contains 1-7, with 1 = Monday
' So the most recent Monday occured 1-DOW days ago
GetMonday = DateAdd("d", (1 - DOW),DateToCheck)
End Function
<imran.saleem@b...> wrote in message news:138666@a..._databases...
>
> Hi,
> i have a slight problem, i have a page with several links. Each of
> these links, when selected, dynamically create a a form that displays 7
> text boxes for each of the days in the week. Thus the first link displays
> 7 text boxes for the next 7 days, the second link displays 7 text boxes
> for the next 7 days after and so on. Beside each text box i have a label
> that displays the date for that particular text box. For example;
>
> Wed 23 Jan <Text Box>
> Wed 24 Jan <Text Box>
> Wed 25 Jan <Text Box>
> ..
> ...
> etc
>
> Currently when i click on the first link i am only able to display text
> boxes for the next 7 days starting from todays date. However i want to be
> able to display text boxes from the first monday of the week for each
> link. For example when i click on the first link even though today is
> wednesday i want Monday and Tuesday`s text boxes being displayed instead
> of just todays and then text boxes for the remaining week. When i click on
> the second link i want to be able to display next weeks text boxes
> beginning from monday and so on.
>
> Any ideas would be really appreciated.
>
>
$subst('Email.Unsub').
|
|
 |