Solved

check event time between start and end

Posted on 2001-06-27
5
194 Views
Last Modified: 2013-12-24
hai, i have a table called event
it contains an event name and start time and end time

if i add a new time to process (in another table), is there anyway to check whether it is within the event time or not?

eg. event A start at 10am to 2pm (store in event table)
i want to add a time, but the computer need to check event table whether there is any event exist, and also check the time.

if i input 11am, since it is within 10 to 2 pm, so cannot
but if i input 3pm, it can be done.

how the programming will look like?

thanks.
0
Comment
Question by:JYnet
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:tleish
ID: 6232067
Do you want to do this in SQL or ColdFusion?  Also, what type of database are you using?
0
 

Author Comment

by:JYnet
ID: 6233899
i am thinking of using coldfusion query to check the table in microsoft access.
:-)
0
 

Author Comment

by:JYnet
ID: 6233906
but what if the event table has option to be add or delete, so i may add another field called date inside the event table.

if something match the date in event table, it will check for start time and end time.
anything within start time and end time will not be processed.
0
 

Accepted Solution

by:
rac13 earned 20 total points
ID: 6234366
Try if this works:

<cfquery name="check_date" db="DB_Name">
SELECT event_id FROM event_table
WHERE #new_Date# NOT BETWEEN (start_date) AND (end_date)
</cfquery>

<cfif #check_date.recordcount# > 0>
   <!--- Do not insert --->
<cfelse>
   <!--- Insert into DB --->
</cfif>
0
 

Expert Comment

by:rac13
ID: 6618019
Thanks. :)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now