Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
HiI have 2 tables Range and Sales.In my Range Table is a startdate and enddate.my sales have a salesDateI would like to be able to retrieve my sales where the sales date is NOT in the range table( between any startdate enddate of the record).is there anyway of doing this in sql?
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2005-06-23 : 03:35:57
Post table structuresMadhivananFailing to plan is Planning to fail
jen
Master Smack Fu Yak Hacker
4110 Posts
Posted - 2005-06-23 : 04:41:50
set crystal_ball ondeclare @startdate smalldatetime,@enddate smalldatetimeselect @startdate=startdate, @enddate=enddate from myRangeselect field1,field2 from mysaleswhere salesdate not between @startdate and @enddateset crystal_ball offgo--------------------keeping it simple...
Biltongboere
Starting Member
3 Posts
Posted - 2005-06-23 : 05:38:10
Thank You it works Perfectly
coolerbob
Aged Yak Warrior
841 Posts
Posted - 2005-06-23 : 06:47:21
Mooi so groot seun. Kom terug enige tyd
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2005-06-23 : 06:53:28
quote:Originally posted by coolerbob Mooi so groot seun. Kom terug enige tyd
Which language is it?And what does it mean? MadhivananFailing to plan is Planning to fail
Biltongboere
Starting Member
3 Posts
Posted - 2005-06-23 : 08:27:22
quote:Originally posted by madhivanan
quote:Originally posted by coolerbob Mooi so groot seun. Kom terug enige tyd
Which language is it?And what does it mean? MadhivananFailing to plan is Planning to fail
It is afrikaans a language spoken in South Africa and Namibia (+/- 97 % of Namibians can speak it) It roughly translated means "come back any time"