Viewing 15 posts - 1 through 15 (of 178 total)
Hi,
I got this working a lot faster (registering zero seconds :w00t:) by getting rid of the dateadd datediff out of the join statement.
The report query now looks like:
SELECT
...
June 10, 2010 at 3:15 am
Also,
here's the script to populate the temp test table with arrival dates sans time component.
INSERT INTO #Stay (GuestID, ArrivalDate, TotalRevenue)
SELECT TOP 2000000
NEWID(),
DATEADD(DD,...
June 9, 2010 at 8:32 am
Ah, i see where the confusion was arising, you added a day, instead of a month in the less than part of each join condition:
So report query with your join...
June 9, 2010 at 8:31 am
Thanks for the reply Wayne,
Arrival date has no time associated with it on live data.
However, not sure what you mean with regards the join?
Checking the report query with my join...
June 9, 2010 at 8:19 am
Brilliant Jeff, thanks a million!
February 19, 2010 at 11:48 am
Hi Premal,
the following will give you the syntax of the create table http://msdn.microsoft.com/en-us/library/aa258255%28SQL.80%29.aspx
If you are having a particular problem using this command re-post detailing your issue.
Regards
January 10, 2010 at 7:45 am
The only successful means I have come across is creating an ordering column, example can be found at http://blog.beyondrelational.com/2008/10/ordering-hierarchical-data.html
Please note that you will get incorrect results if you have more...
November 29, 2009 at 5:57 am
Thought you guys might like this one: http://thedailywtf.com/Articles/Slightly-OverSQLd.aspx
November 6, 2009 at 3:46 am
Charles Kincaid (11/3/2009)
GilaMonster (11/3/2009)
What are you waiting for?Methinks he is waiting for your next installment.
Me too!
Thanks for the great article.
November 4, 2009 at 1:53 am
A cross-tab query as Ian has provided is the way to tackle this problem, you'll just have to get your group by correct so that the rows of you results...
October 28, 2009 at 6:03 am
Hi,
sorry, but I'm about to leave an OP hanging... am trying to get packed to go on holiday, and started into a avg/aggregate/median problem I haven't got a mission of...
October 22, 2009 at 4:17 pm
If you can post some sample data from your sub query:
select week=DATEADD(wk, DATEDIFF(wk, 7, calldate), 7),
count(I3_RowID) as total, 1 As Lead,
From
test
where
(CallDate between '10/1/09' and '10/22/09')
and (reason<>'deleted' or reason<>'wrongparty' or reason<>'Success'...
October 22, 2009 at 3:07 pm
Hi,
this is really good resource: http://www.sqlservercentral.com/articles/T-SQL/62867/
October 22, 2009 at 11:32 am
Hi, you may find the following useful: http://www.simple-talk.com/sql/t-sql-programming/median-workbench/
October 22, 2009 at 11:18 am
Hi,
I used this to get rid of all £ signs out of data, you should be able to revise it for your purposes.
DECLARE @TableName VARCHAR(255)
SELECT @TableName = 'TableName'
October 22, 2009 at 11:14 am
Viewing 15 posts - 1 through 15 (of 178 total)