I am getting this error :The right function requires 2 argument(s).

declare 
@startdate datetime,
@enddate datetime 
SET @STARTDATE ='01-MAR-2014'
SET @enddate = '01-MAR-2014'
Set @StartDate = Convert(datetime, Convert(char(10), @StartDate, 120) + ' 00:00:00', 120)
set @enddate =convert(datetime,Convert(char(10),@enddate, 120) + ' 23:59:59',120) 
SELECT 
[row_date]
,[logid]
,CONVERT(VARCHAR(6), (ISNULL(SUM([acwouttime] + [auxouttime] + [holdtime]), 0))/3600) + 
':' + RIGHT('0' + CONVERT(varchar(2),(ISNULL(SUM([acwouttime] + [auxouttime] + [holdtime]), 0)) % 3600) / 60), 2)
+ ':' + RIGHT('0' + CONVERT(varchar(2), (ISNULL(SUM([acwouttime] + [auxouttime] + [holdtime]), 0)) % 60), 2)AS HoldTime
FROM [CMSData].[dbo].[hagent2]
WHERE ([logid] IN (1382, 1493,1382,1493,1444,1466,1301,1074,1655,
1749,1685,1686,1684,1617,1681,1792,1595,1597,1687,1622))
AND (row_date BETWEEN  @StartDate AND @EndDate)
GROUP BY 
[row_date]
,[logid]
hi friends when I am executing this query I am getting this error please help me I will grateful to you .
ERROR: The right function requires 2 argument(s).

you may be better off making date filter as below
declare
@startdate datetime,
@enddate datetime
SET @STARTDATE ='01-MAR-2014'
SET @enddate = '02-MAR-2014'
AND (row_date >= @StartDate AND row_date <@EndDate)
see
http://visakhm.blogspot.in/2012/12/different-ways-to-implement-date-range.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

Maybe you are looking for

  • Transport Collection includes Logical System?

    Hi, I am collecting up Object for the BW Admin Cockpit and the collected list includes the BW Logical System as well.  I can't understand why this would get picked up and I don't know what the consequences are for transporting this.  The Transport Co

  • [solved] USB drives won't auto mount

    When I plug in a drive, I get this error message: Rejected send message, 1 matched rules; type="method_call", sender=":1.24" (uid=1000 pid=4499 comm="exo-mount) interface="org.freedesktop.Hal.Device.Volume" member="Mount" error name="(unset)" request

  • Compiler not reporting unreachable code

    I had obvious bug code after return, but compiler did not even reported an error should not it flag it as unreachable code?) is that normal?

  • Recovering the rules app from one export/import (HOWTO?)

    Hello Aravind: I'm having an issue with my rules app. Our customer has a requirement. They want to export the production environment to the test environment, to have the data updated, and be able to reproduce recent issues to create a report. The pro

  • Running thread - which statement to get to know what this thread is doing

    Hallo, I have a thread in my database running. Normally the action I am doing with this thread lasts 1 hour. Now it is working for 3 hours. How can I get to know what my thread is doing and how long this will last? Which statement can I use? Thanks i