Viewing 15 posts - 2,221 through 2,235 (of 4,080 total)
That's how I interpreted it, Gail. This was my quick-and-dirty solution.
declare @sample table (channel varchar(5), line_of_bus varchar(5), prod_nm varchar(20))
insert into @sample
select 'all', 'C1','last year p&c' union all
select 'all',...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 2:06 pm
Couple of observations:
1. You don't have daily data, yet you say you want to calculate MTD (month-to-date). Did you mean to say YTD (year-to-date)?
2. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 1:05 pm
Or he got run over by a bus... :crying:
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 12:16 pm
Here's an example of a query to list parameters from the procedure "testProc".
create procedure dbo.testProc
@parm1 int = null
...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 11:50 am
You're welcome, PSB. Could you please take another minute to explain to us why this was "urgent"? That is a word that is being used...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 11:46 am
Both are marked urgent, both don't give the proper table definitions or sample data, one gets the answer within 5mins and the other is made fun of. Any particular reason?
I...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 11:29 am
An opening parenthesis is missing. It should read: OVER (PARTITION BY etc
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 9:36 am
I was going to ask if you had a preference about which account name to keep. The one with spaces, or the one without?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 9:33 am
Just a note for the future, consider moving away from using TEXT fields to Varchar(Max) or Nvarchar(Max).
As for the single statemement, consider something like this. (coded freehand and...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 9:26 am
BUT I would suggest that there are probably a lot of people out there like me who trying to do their best in a difficult but rewarding job, working long...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 9:05 am
Chris, I am not bothered at all by basic questions from beginners. The irritation comes from people who post next to no background information and expect us to fill...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 6:58 am
To trap an event before it happens you have to use INSTEAD OF in your trigger. The syntax is readily available in the help on line for...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 13, 2009 at 7:14 pm
You can also read up on PIVOT/UNPIVOT. 🙂
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 13, 2009 at 7:02 pm
Do you mean something like this?
SELECT
sum(case when invoiceDate = CAST(CONVERT(CHAR(8),GETDATE(),112) AS DECIMAL(8,0)) then 1 else 0 end) as d1
,sum(case when invoiceDate = CAST(CONVERT(CHAR(8),GETDATE()-1,112) AS DECIMAL(8,0)) then 1 else...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 13, 2009 at 6:59 pm
Ahhhhh.... you beat me to it Michael! I just remembered doing a function for one of our developers to list the parms in a stored proc.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 13, 2009 at 4:03 pm
Viewing 15 posts - 2,221 through 2,235 (of 4,080 total)