Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Smalldatetime related

Author  Topic 

d0153030
Starting Member

8 Posts

Posted - 2004-11-08 : 02:03:16
Hello

What shuld be the query for:
1.0 sorting id from the table filtered by the range of the dates?
i.e. Select id FROM TableName WHERE date is in between DT1 and DT2

My date filed in the database is smalldatetime, I am using in the VB form two DTPicker. I just want to get the Dates from both DTPicker and to put in the query

How to do this?

Next if i want to get data from the table with particular date record.

D0153030

Leave Your Marke Wherever You Go

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2004-11-09 : 14:54:21
Are you using another language on the front-end of your program?

Brenda

If it weren't for you guys, where would I be?
Go to Top of Page

samamun001
Starting Member

17 Posts

Posted - 2004-11-09 : 23:10:45
This thing should work
select EmployeeID from Employees where JoinDate between '11/01/2004' and '11/02/2004'
Dt1 Dt2
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-11-10 : 00:36:40
quote:
Originally posted by d0153030

Hello

What shuld be the query for:
1.0 sorting id from the table filtered by the range of the dates?
i.e. Select id FROM TableName WHERE date is in between DT1 and DT2

My date filed in the database is smalldatetime, I am using in the VB form two DTPicker. I just want to get the Dates from both DTPicker and to put in the query

How to do this?

Next if i want to get data from the table with particular date record.

D0153030

Leave Your Marke Wherever You Go



do you know how to get the data from datepicker? if it's vb then it's datepicker1.text or value (i think).

your query should look like this:

"select id from tablename where dateField between '" & datepicker1.value & "' and '" & datepicker2.value & "'"

you can use = operator for particular date record

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -