Solved

check event time between start and end

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

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Question has a verified solution.

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

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

16 Experts available now in Live!

Get 1:1 Help Now