Search Results

Showing results 1 to 3 of 3
Search took 0.00 seconds.
Search: Posts Made By: cmhampton ; Forum: MS SQL and child forums
Forum: MS SQL Jul 11th, 2008
Replies: 8
Views: 1,217
Posted By cmhampton
Can you give me a little more information about what this particular query is trying to do? You may not need to use UNION, but perhaps different JOINs.
Forum: MS SQL Jul 11th, 2008
Replies: 8
Views: 1,217
Posted By cmhampton
Try this:


SELECT
hourStamp,
NULL AS ActualVisits,
SUM(CASE WHEN datestamp < GETDATE() THEN 1 ELSE 0 END) / @numberofdays as HourAverage,
SUM(CASE WHEN dateStamp BETWEEN...
Forum: MS SQL Mar 24th, 2008
Replies: 2
Views: 3,627
Posted By cmhampton
Not sure if this is what you are looking for:


DECLARE tempCursor CURSOR FOR SELECT col3 FROM table1 WHERE col2 = @col2
OPEN tempCursor
DECLARE @value As int --or whatever your datatype is
...
Showing results 1 to 3 of 3

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC