473,405 Members | 2,445 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,405 software developers and data experts.

Time Syntax problem in IIF statement

Hi everybody,

On my form, I have a time field where the user enters a time, if the user enters a time between 4am and 12pm, I would like my "early checkin" check box to check itself. I thought the below would do it (and Ive tried variations of it) but to no avail.

=IIf([txtArrivalTime]>#04:00:00#,IIf([txtArrivalTime]<#12:00:00#,-1,0))

Do I need to convert time to a number to use the IIF statement, or is my syntax out of wack

Thank you for your attention
Eddie
Apr 8 '08 #1
1 3172
MikeTheBike
639 Expert 512MB
Hi everybody,

On my form, I have a time field where the user enters a time, if the user enters a time between 4am and 12pm, I would like my "early checkin" check box to check itself. I thought the below would do it (and Ive tried variations of it) but to no avail.

=IIf([txtArrivalTime]>#04:00:00#,IIf([txtArrivalTime]<#12:00:00#,-1,0))

Do I need to convert time to a number to use the IIF statement, or is my syntax out of wack

Thank you for your attention
Eddie
HI

I think you have missed an argument ie:

=IIf([txtArrivalTime]>#04:00:00#,IIf([txtArrivalTime]<#12:00:00#,-1,0),0)

Pehaps this is a little simpler ?

=IIf([txtArrivalTime]>#04:00:00# And [txtArrivalTime]<#12:00:00#,-1,0)


MTB
Apr 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

41
by: John Marshall | last post by:
How about the following, which I am almost positive has not been suggested: ----- class Klass: def __init__(self, name): self.name = name deco meth0: staticmethod def meth0(x):
8
by: Nick Coghlan | last post by:
Time for another random syntax idea. . . So, I was tinkering in the interactive interpreter, and came up with the following one-size-fits-most default argument hack: Py> x = 1 Py> def...
2
by: dmiller23462 | last post by:
Hey guys, I'm back again.... I'm trying to put together a search page but what I'm trying to pull off is only showing the past week's entries.... I've tried declaring "pastweek" as a...
4
by: Karaoke Prince | last post by:
Hi There, I have an update statement to update a field of a table (~15,000,000 records). It took me around 3 hours to finish 2 weeks ago. After that no one touched the server and no...
8
by: Peter A. Schott | last post by:
Per subject - I realize I can copy/paste a line at a time into an interactive session when I'm trying to debug, but was wondering if there is any tool out there that allows me to copy sections of...
177
by: C# Learner | last post by:
Why is C syntax so uneasy on the eye? In its day, was it _really_ designed by snobby programmers to scare away potential "n00bs"? If so, and after 50+ years of programming research, why are...
7
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
13
by: Adam Blair | last post by:
Is it possible to bind a switch statement to an Enum such that a compile-time error is raised if not all values within the Enum are handled in the switch statement? I realise you can use default:...
6
by: Heiko Wundram | last post by:
Hi all! The following PEP tries to make the case for a slight unification of for statement and list comprehension syntax. Comments appreciated, including on the sample implementation. ===...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.