473,388 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Time() range

le0
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
Jul 20 '06 #1
2 1574

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

Jul 20 '06 #2
le0
Hey Mike thanks =)
I really apreciate that =)

"Mike Brind" <pa*******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr 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%>"><%= rstShift.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

Jul 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alberto Santini | last post by:
I ported a Jos Stam's demo about Fluid mech to check the difference of speed between C implementation and Python. I think I achieved good results with Python and there is space to improve, without...
5
by: Sheila King | last post by:
I have a web app that has been running just fine for several months under Python 2.2.2. We are preparing to upgrade the server to run Python 2.4.1. However, part of my web app is throwing an...
2
by: Maksim Kasimov | last post by:
there are few of a time periods, for example: 2005-06-08 12:30 -> 2005-06-10 15:30, 2005-06-12 12:30 -> 2005-06-14 15:30 and there is some date and time value: 2005-06-11 12:30 what is the...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
6
by: SJ | last post by:
howdy, In vb6 I could say If Time >#4:00:00 PM# And Time < #4:01:00 PM# Then 'Do Something End If Well, I don't see the Time function in vb.net. I have experimented with the TimeSpan...
4
by: Seth7TS | last post by:
Hi, I want to make a trial version of a software but if i read the system clock the user can modify it... how can i prevent this?? i thought to read the time from internet but i don't know if...
2
by: LadyRed2 | last post by:
Hello, I am new to Excel and SQL server, so please be patient with me. I have written code with the help of others to update a table in a sql database from an excel form. The connection code...
8
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi just wondering if anyone had any ideas on how to do this in C#. I am trying to get the total time of several start and stop time data entries. For example the input data looks like starttime...
0
by: 362315 | last post by:
I am receiving the following error: Microsoft Visual Basic Run-Time error '2147467259 (80004005)': The microsoft jet database engine cannot open the file. It is already opened exclusively by...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.