473,511 Members | 14,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date and Time comparison

29 New Member
Hi,

I fix an appointment for a patient at one time frame, when I add another appointment for someother patient for the same time frame, I should show them that the appointment is fixed already, sample data is given below

I have two fields as date datatypes

time from : 06/09/2010 08:00:00 AM

time to : 06/09/2010 10:00:00 AM

This is the data available in the database

Now I want to check for the existence of this time frame with the new time frame

These are the test data

I should not be able to fix appointment in the following time frame
1. 08:00 AM and 10:00 AM
2. 08:30 AM and 10:00 AM
3. 09:00 AM and 10:00 AM
4. 09:59 AM and 10:30 AM
because all these time frames already comes under already saved apppointment time frame (08:00 and 10:00)

I must allow the client to save the record only time frame not within the above mentioned time range

How do I write query?

thanks in advance
Sep 6 '10 #1
1 2187
amitpatel66
2,367 Recognized Expert Top Contributor
Can you provide more insight on your requirement? Sample data and sample output expected would help.
Sep 14 '10 #2

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

Similar topics

8
9425
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
2259
by: Jon | last post by:
Hi, I am trying to pick up records from a date range without much luck. For my example below I am trying to pick up all records made in the last month. However none are being found (my code is...
21
11033
by: Javier | last post by:
Hi I´ve a routine that will read date and times in a vector of strings ie: 30/02/2005 19:20 In some moment I´ll need to check if there are in vector a date like current date with a time...
4
13873
by: mc | last post by:
How to do a time comparison? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.782 / Virus Database: 528 - Release Date:...
3
3274
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
2
2196
by: Nazeer | last post by:
Hi I am working in sharepoint portal sever 2007. I am filter data in data view based on some data time column (example startdate). Data view filter rows if i gave equl condition like . If i...
3
1954
by: tdes42 | last post by:
I believe I am looking for some form of Join Query, but my understanding of Access logic and my logic do not yet click entirely…. I have a table of ocean buoy data, taken every hour over many...
4
2100
by: Nathan Sokalski | last post by:
When determining whether a String can be converted to a DateTime, you can use the IsDate() method. However, I would also like to know whether the string is a date, a time, or both a date and a...
6
2810
by: Jim Mandala | last post by:
Using MS Access 2003 with SQL Server 2005 as a backend: I am trying to automatically check for collisions in a table of appointments with an appointment currenlty being saved from the form...
4
32942
by: ahmurad | last post by:
Dear Brothers, I am struggling the following four Date-Time type values which were inputted into MYSQL database in different tables. As MYSQL Default Time Format: YYYY-MM-DD HH:MM:SS, So I used...
0
7237
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
7137
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
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7074
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
7506
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...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.