Viewing 15 posts - 1,621 through 1,635 (of 2,452 total)
Mr. Kapsicum (6/14/2013)
i know a trigger can work...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 15, 2013 at 8:22 am
may be this will get you started....
you will also need a "Tally" table...search this site for guides
suggest you read up on dynamic pivot/cross tabs as well
CREATE TABLE [dbo].[TransData](
[Fromdate] [datetime] NOT...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 9, 2013 at 9:22 am
kashyapshah109 (6/5/2013)
I want to know some basics as I am new to sqlserver, is there anyone can help me?
SQL is a BIG subject....as you don't give any details of what...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 5, 2013 at 3:04 pm
Jeff Moden (6/5/2013)
Tyekhan (6/5/2013)
Randomizing ContactID's and CallDateTime's...
(1000000 row(s) affected)
Building/populating the #HistoryTest table...
Msg 208, Level 16, State 1, Line 19
Invalid object name 'AdventureWorks.Person.Contact'.
J Livingston...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 5, 2013 at 11:56 am
that's not the code from Jeff Moden...that's mine...go back a few posts
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 5, 2013 at 9:39 am
suggest you revisit the solution that Jeff Moden gave you.....just swap out the table name and I think you will need to replace "Num" with "PID"...that should give you what...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 5, 2013 at 7:15 am
deleted....misread number pf rows
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 4, 2013 at 11:13 pm
Hi Jeff
as always, you have done a lot more detailed testing on this.....have you come to any further conclusions ??
sorry for late reply but have had a few days vacation.
regards
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 4, 2013 at 10:52 am
Tyekhan (6/4/2013)
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#mytable','U') IS NOT NULL
...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 4, 2013 at 9:41 am
hmmm....take a look at this data set....I don't think you are going to get what you expect.
suggest that you read up on using a calendar table instead of the CTE...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 4, 2013 at 4:48 am
see if this helps....
DECLARE @Date DateTime;
set @Date = GetDate();
/* see changes made to the CTE */
WITH CTE AS
(
SELECT
TrnYear,
TrnMonth,
ROW_NUMBER() OVER( ORDER BY TrnYear DESC, TrnMonth DESC) rn
FROM (
SELECT DISTINCT
TrnYear,
TrnMonth
FROM #mytemptable
WHERE...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
June 4, 2013 at 4:27 am
so....heres some dev code to get you started...have left it all broken out into tables so that you can see what is going on....
not sure how performant it will be..maybe...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
May 21, 2013 at 12:53 pm
Hi..just to be sure and possibly save time later on...does your sample data provide all the possible situations you have in the real data.
if it doesn't...then please provide all the...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
May 20, 2013 at 11:36 am
Hi
where do these two columns come from
"TOTAL Remaining Points (Rewards + Bonus points)"
you have pointsearned and pointsused
??
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
May 20, 2013 at 10:28 am
maybe something along these lines
SELECT Product.ProductId, COUNT([Transaction].transactionId)
FROM Product LEFT OUTER JOIN
...
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
May 20, 2013 at 8:41 am
Viewing 15 posts - 1,621 through 1,635 (of 2,452 total)