472,358 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 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 1544

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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.