Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql queries to find a range of dates

Status
Not open for further replies.

coyote69

Technical User
Feb 19, 2002
45
US
I am trying to find a range of dates from a user input such as beg date and ending date. I get and error when trying to search the date. this happen when it tries to refresh the data. the database is connected through the databound controls in vb. Also I have two fields one with the appointment date and one with the appointment. I need to be able to send a message to the user that the appointment time that he is entering in the appointment textbox is already taken for any given date.
 
The first, I guess would be:

SELECT * from table where dateField between cdate(date1) and cdate(date2)

The second:

SELECT 'TAKEN' where exists (select * from table where datefield = date)

(as you can see I'm not that good with SQL, but i think it would work)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top