Solved

check event time between start and end

Posted on 2001-06-27
5
200 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

730 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