Forum Replies Created

Viewing 15 posts - 16 through 30 (of 33 total)

  • RE: probem with declare

    Are you trying to select only the insert statement and only execute that? If so, execute the entire script and not just insert statement.

  • RE: Week Grand Total not equal to sum across 7 days

    If NumberOfUsers (distinct count of Users) each day were as below:

    Sunday = 10

    Monday = 10

    Tuesday = 20

    Wednesday = 20

    Thursday = 30

    Friday = 30

    Saturday = 40

    I expect that these values add...

  • RE: Week Grand Total not equal to sum across 7 days

    Hi Lutz,

    The Week is defined Sunday through Saturday. Also, it is actually the Time Dimension I have with Hierarchies as :

    1. Year> Qtr > Month > Day

    2.Week -...

  • RE: Totals and Grand Total working worng in SSAS

    Hey,

    Do let me know in case any solution to this problem. I have been stuck with it for 3 days, and its freaking me out. :w00t:

  • RE: kindly give some solution

    The point being driven here is that when we store " EXACTLY SAME" string data as char in one table and as varchar in the other table there is a...

  • RE: kindly give some solution

    The question was to practically demo how char uses up more space than varchar, so here's the demo.

    I created two tables, VarChar_Table and Char_Table as below:

    create table Char_Table (name char(100))

    create...

  • RE: SSIS FTP Task - Cannot Find File Error

    Faced the same problem and the solution to DELAY VALIDATION posted above is just perfect. When you delay validation, it checks for the file only at the time of execution.

  • RE: XML Output Question

    You may achieve that using a FOR XML AUTO clause at the end your query. Hope this is what you were looking for.

  • RE: How to optimize this query

    You might as well better the query using a CTE. You can avoid the cost of creating and inserting into a temp table.

    WITH CTE (QuestionID)

    AS

    (select distinct sf.questionID

    ...

  • RE: Which procedures or function srae using my table???

    You might as well use below query to find any sproc that uses your table.

    select * from INFORMATION_SCHEMA.ROUTINES

    where ROUTINE_DEFINITION like '%YourTableName%'

  • RE: comparing the varchar data type value

    You might as well refer to Grant's answer above as to what the answer in this case can be attributed to.

  • RE: question on date functions: dateadd(qq,datediff(qq,-1,GETDATE()),-1)

    Consider your first statement:

    dateadd(qq,datediff(qq,-1,GETDATE()),-1)

    1. GETDATE() gets you current date

    2. 0 here represents system start date which is 1900-01-01 00:00:00.000

    3. -1 here represents a year before 1900 i.e 1899

    4. qq is...

  • RE: query help

    With the table structure and values as below:

    create table a

    (ID int, Orderdate datetime)

    insert into a values

    (1,GETDATE()),

    (1,GETDATE()-3),

    (1,GETDATE()-2),

    (1,GETDATE()-1),

    (1,GETDATE()-4),

    (2,GETDATE()-1),

    (2,GETDATE()-2),

    (2,GETDATE()-3),

    (2,GETDATE()-4)

    The below query gives you the second highest date without having to perform joins.

    with...

  • RE: comparing the varchar data type value

    To answer why you get the else select statement in the output,whenever you compare strings for less than or greater, the comparison occurs between the ASCII values generated for the...

  • RE: Help me asap pleas

    The solution you used here is temporary result set,CTE. You could as well have achieved this using a simple query like:

    select <your col1>, a.sum as sum1, b.sum as sum2,(a.sum-b.sum) as...

Viewing 15 posts - 16 through 30 (of 33 total)