Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Time() range

Reply
Thread Tools

Time() range

 
 
le0
Guest
Posts: n/a
 
      07-20-2006
Hello Guys,

I have this dropdown box and the options is TimeShift (6a-2pm, 2p-10p, 10p-6a ), im getting this data in a table (Acess DB) . My problem is how can i display (option selected) the actual shift based on the actual time.

Code:

<td width="100" height="5"><select size="1" name="ddShift">

<%Do While Not rstShift.EOF%>
<option value="<%=rstShift.Fields("ShiftID").Value%>"><%=r stShift.Fields("Shift").Value%></option>
<%
rstShift.Movenext
Loop
%>

or can i do it manually, but the problem is the <Condition statement>, im using "Between" like querying a date range in a database but it doesnt work. How can i get the range in Time()? Please Helpppp...

<%if <Condition> then%>
<option selected value="A"><%="6am-2pm"%></option>
<%end if%>

btw im using Frontpage and ASP Classic
 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      07-20-2006

le0 wrote:
> Hello Guys,
>
> I have this dropdown box and the options is TimeShift (6a-2pm, 2p-10p, 10p-6a ), im getting this data in a table (Acess DB) . My problem is how can i display (option selected) the actual shift based on the actual time.
>
> Code:
>
> <td width="100" height="5"><select size="1" name="ddShift">
>
> <%Do While Not rstShift.EOF%>
> <option value="<%=rstShift.Fields("ShiftID").Value%>"><%=r stShift.Fields("Shift").Value%></option>
> <%
> rstShift.Movenext
> Loop
> %>
>
> or can i do it manually, but the problem is the <Condition statement>, im using "Between" like querying a date range in a database but it doesnt work. How can i get the range in Time()? Please Helpppp...
>
> <%if <Condition> then%>
> <option selected value="A"><%="6am-2pm"%></option>
> <%end if%>
>
> btw im using Frontpage and ASP Classic


<%
Dim shift
shift=""
If DatePart("h", Now()) > 5 And DatePart("h", Now()) < 14 Then shift =
" selected"
If DatePart("h", Now()) > 13 And DatePart("h", Now()) < 22 Then shift =
" selected"
If DatePart("h", Now()) > 21 Or DatePart("h", Now()) < 6 Then shift = "
selected"
%>

<option value="A" <%=shift%>>6am-2pm</option>
<option value="B" <%=shift%>>2pm-10pm</option>
<option value="C" <%=shift%>>10pm-6am</option>

--
Mike Brind

 
Reply With Quote
 
 
 
 
le0
Guest
Posts: n/a
 
      07-20-2006
Hey Mike thanks =)
I really apreciate that =)

"Mike Brind" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> le0 wrote:
>> Hello Guys,
>>
>> I have this dropdown box and the options is TimeShift (6a-2pm, 2p-10p,
>> 10p-6a ), im getting this data in a table (Acess DB) . My problem is how
>> can i display (option selected) the actual shift based on the actual
>> time.
>>
>> Code:
>>
>> <td width="100" height="5"><select size="1" name="ddShift">
>>
>> <%Do While Not rstShift.EOF%>
>> <option
>> value="<%=rstShift.Fields("ShiftID").Value%>"><%=r stShift.Fields("Shift").Value%></option>
>> <%
>> rstShift.Movenext
>> Loop
>> %>
>>
>> or can i do it manually, but the problem is the <Condition statement>, im
>> using "Between" like querying a date range in a database but it doesnt
>> work. How can i get the range in Time()? Please Helpppp...
>>
>> <%if <Condition> then%>
>> <option selected value="A"><%="6am-2pm"%></option>
>> <%end if%>
>>
>> btw im using Frontpage and ASP Classic

>
> <%
> Dim shift
> shift=""
> If DatePart("h", Now()) > 5 And DatePart("h", Now()) < 14 Then shift =
> " selected"
> If DatePart("h", Now()) > 13 And DatePart("h", Now()) < 22 Then shift =
> " selected"
> If DatePart("h", Now()) > 21 Or DatePart("h", Now()) < 6 Then shift = "
> selected"
> %>
>
> <option value="A" <%=shift%>>6am-2pm</option>
> <option value="B" <%=shift%>>2pm-10pm</option>
> <option value="C" <%=shift%>>10pm-6am</option>
>
> --
> Mike Brind
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I transform source range to destination range that is thesame as source? Lambda C++ 2 07-16-2008 05:18 PM
'ArgumentError: bad value for range' for range of Times David Bird Ruby 1 06-23-2008 12:12 PM
range() is not the best way to check range? Summercoolness@gmail.com Python 46 07-25-2006 08:10 PM
Scene range vs dynamic range Robert Feinman Digital Photography 2 07-04-2005 09:30 PM
Range does not take an Range object. Tomoyuki Kosimizu Ruby 3 11-27-2003 12:42 AM



Advertisments