Forum Replies Created

Viewing 15 posts - 196 through 210 (of 242 total)

  • RE: Divide by Zero - bit lost

    Hi,

    Instead your query, try this:

    (SUM(dbo.t_DirectHighLevelSummary.FlashConn) +

    SUM(dbo.t_DirectHighLevelSummary.TalkConnQWBR) -

    SUM(dbo.t_DirectHighLevelSummary.SimplicityConn1))

    - SUM(dbo.t_DirectHighLevelSummary.TalkMobileConn) / CASE WHEN SUM(dbo.t_DirectHighLevelSummary.TGM)=0 THEN 1 ELSE SUM(dbo.t_DirectHighLevelSummary.TGM) END

  • RE: tricky SQL

    --Try This

    --However this is not much optimized but will serve your purpose

    SELECT client_id,Row_Number() OVER (ORDER BY start_date ASC) stay_number,start_date,end_date

    FROM (

    SELECT client_id,

    Case When event_desc='discharge' Then Null Else effective_date End start_date,

    (SELECT...

  • RE: How to use tooltip asdynamic incharts

    Hi Swati,

    There is limitation in SSRS 2005 tooltip features.

    You can't use dynamic tooltip for charting in SSRS - 2005 because its static for chart.

    It means that you can set only...

  • RE: to find 4th maximum in a sql table

    Hii,

    There are different ways to get this..!

    Try This...

    ----------------------------------------------------------

    DECLARE @Emp Table ( ID int, Name Varchar(10), Salary int)

    INSERT INTO @Emp

    SELECT 1,'A',20000 UNION

    SELECT 2,'B',25000 UNION

    SELECT 3,'C',15000 UNION

    SELECT 4,'D',18000 UNION

    SELECT 5,'E',22000 UNION

    SELECT 6,'F',24000...

  • RE: Conditionally Calling a StoredProcedure

    Gurumoorthy,

    we can use Functions in dynamic queries....

    there is no problem using functions in Dynamic queries

  • RE: SQL query Question

    Hi,

    Just change your query slightly:

    SELECT s.SensorID, sd.InCount, sd.OutCount,sd.RecTimeStamp

    FROM Sensors s join SensorDetails sd on s.SensorID = sd.SensorID

    WHERE sd.RecTimeStamp =

    (SELECT MAX(RecTimeStamp) FROM SensorDetails WHERE SensorID=s.SensorID)

  • RE: Adding a new column between existing columns..

    Yep.... Greg Charles is True

  • RE: Conditionally Calling a StoredProcedure

    Hi Gurumoorthy,

    You can't execute procedure in this way.

    It could be better if you have had Table Valued Function instead of Stored Procedure. Because you can't use SP in SELECT, WHERE...

  • RE: Datetime

    --Try this code

    DECLARE @DATE DATETIME

    SET @DATE = GETDATE()

    --1. Set the date to the current date in format:- 2008-06-26 00:00:00:000

    SELECT CAST(CONVERT(VARCHAR(20),@DATE,102) AS DATETIME)

    --2. Get the current time in the following...

  • RE: One big row...

    But in your case, I am not getting what you want to do.

    Can you post sample data with example.

  • RE: One big row...

    Hi,

    The result set column names of a UNION are the same as the column names in the result set of the first SELECT statement in the UNION. The result set...

  • RE: Beginner in need of advice

    Hi,

    You can create stored procedure of view for your result and use the same for your report.

    If you create a procedure, apply order by condition inside procedure.

    If you create a...

  • RE: Conditionally Calling a StoredProcedure

    If you want to store the result in a table then table must be created prior to execute the procedue

    like:

    Create Table #T(ID int, Name varchar(100), DOB DateTime)

    Declare @Val1 int,@Val2 int,@Val3...

  • RE: Conditionally Calling a StoredProcedure

    If you want to execute stored procedure conditionally then you can do like this:

    Declare @Val1 int,@Val2 int,@Val3 int,@Val4 int

    SELECT @Val1=1,@Val2=2,@Val3=3,@Val4=4

    IF (Condition)

    EXEC ProcName @Val1,@Val2

    Else

    ...

  • RE: Conditionally Calling a StoredProcedure

    Hi,

    Your question is incomplete

Viewing 15 posts - 196 through 210 (of 242 total)