Click here to Skip to main content
15,890,845 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to store IList in sql server Pin
Jordon4Kraftd23-Dec-09 10:03
Jordon4Kraftd23-Dec-09 10:03 
QuestionSQL Server Connect Test Pin
mobius11100122-Dec-09 4:43
mobius11100122-Dec-09 4:43 
AnswerRe: SQL Server Connect Test Pin
David Mujica22-Dec-09 5:27
David Mujica22-Dec-09 5:27 
QuestionMerge Replication Problem Pin
Jay Royall21-Dec-09 23:05
Jay Royall21-Dec-09 23:05 
AnswerRe: Merge Replication Problem Pin
Jay Royall23-Dec-09 1:59
Jay Royall23-Dec-09 1:59 
QuestionQuery Pin
sarang_k21-Dec-09 22:04
sarang_k21-Dec-09 22:04 
AnswerRe: Query Pin
Blue_Boy21-Dec-09 22:33
Blue_Boy21-Dec-09 22:33 
AnswerRe: Query Pin
Niladri_Biswas22-Dec-09 16:32
Niladri_Biswas22-Dec-09 16:32 
Try this

declare @t table(somevalue varchar(100),startdate datetime, enddate datetime)
insert into @t 
	select 'somevalue1','01/14/2009', '01/20/2009' union all
	select 'somevalue2','01/15/2009', '01/22/2009' union all
	select 'somevalue3','01/18/2009', '01/31/2009' union all
	select 'somevalue4','02/01/2009', '02/10/2009' union all
	select 'somevalue5','05/14/2009', '05/20/2009' 


I want to get the records where between '01/14/2009' and '02/01/2009' (inclusive)

Query:

select * from @t
where startdate >='01/14/2009' and enddate <='02/01/2009'


Output:

somevalue startdate enddate
somevalue1	2009-01-14 00:00:00.000	2009-01-20 00:00:00.000
somevalue2	2009-01-15 00:00:00.000	2009-01-22 00:00:00.000
somevalue3	2009-01-18 00:00:00.000	2009-01-31 00:00:00.000

Smile | :)

Niladri Biswas

Questionerror in restore Pin
NarendraSinghJTV21-Dec-09 20:19
NarendraSinghJTV21-Dec-09 20:19 
AnswerRe: error in restore Pin
Ashfield21-Dec-09 23:10
Ashfield21-Dec-09 23:10 
GeneralRe: error in restore Pin
NarendraSinghJTV21-Dec-09 23:49
NarendraSinghJTV21-Dec-09 23:49 
GeneralRe: error in restore Pin
Vimalsoft(Pty) Ltd22-Dec-09 2:24
professionalVimalsoft(Pty) Ltd22-Dec-09 2:24 
GeneralRe: error in restore Pin
NarendraSinghJTV22-Dec-09 18:02
NarendraSinghJTV22-Dec-09 18:02 
GeneralRe: error in restore Pin
Vimalsoft(Pty) Ltd22-Dec-09 18:52
professionalVimalsoft(Pty) Ltd22-Dec-09 18:52 
Questionget encrypted passwords from sql using encryption string Pin
220821-Dec-09 17:21
220821-Dec-09 17:21 
AnswerRe: get encrypted passwords from sql using encryption string Pin
Jörgen Andersson21-Dec-09 21:19
professionalJörgen Andersson21-Dec-09 21:19 
Questionstored procedure for restore .bak file Pin
NarendraSinghJTV21-Dec-09 17:11
NarendraSinghJTV21-Dec-09 17:11 
AnswerRe: stored procedure for restore .bak file Pin
Vimalsoft(Pty) Ltd22-Dec-09 2:26
professionalVimalsoft(Pty) Ltd22-Dec-09 2:26 
QuestionHelp building Trigger for updating summary table [modified] Pin
MAW3021-Dec-09 11:29
MAW3021-Dec-09 11:29 
AnswerRe: Help building Trigger for updating summary table Pin
Mycroft Holmes21-Dec-09 23:56
professionalMycroft Holmes21-Dec-09 23:56 
Questiontransaction error Pin
ademsandeepreddy20-Dec-09 19:53
ademsandeepreddy20-Dec-09 19:53 
AnswerRe: transaction error Pin
Member 450194023-Dec-09 7:31
Member 450194023-Dec-09 7:31 
QuestionNeed help with creating dynamic SQL statement Pin
James Shao20-Dec-09 17:54
James Shao20-Dec-09 17:54 
AnswerRe: Need help with creating dynamic SQL statement Pin
Mycroft Holmes21-Dec-09 11:00
professionalMycroft Holmes21-Dec-09 11:00 
QuestionNeed help with DATEDIFF function Pin
James Shao20-Dec-09 17:29
James Shao20-Dec-09 17:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.