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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Uncommon record within a date range
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 01/31/2013 :  17:10:12  Show Profile  Reply with Quote

i'm trying to find uncommon records within a date range. i'm somewhat successful, but i only get records for the first date of my criteria not the rest of them.

this is what i wrote :

SELECT	item1, @date
FROM	table1
		SELECT	item
		FROM 	table2
		WHERE 	Date >= CONVERT(datetime, @Date) AND
			Date <= DATEADD(DAY, 2, CONVERT(datetime, @Date)))

as i said, i only get the first day's record, but not the other days in the range.

can anyone help me? i'm using sql 7

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/01/2013 :  02:42:32  Show Profile  Reply with Quote
i didnt get your exact scenario. what are table1,table2 etc? which is table that contain range values and from which table you're trying to select? show some sample data and explain what you want

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.37 seconds. Powered By: Snitz Forums 2000