Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, Please help in fixing the

Status
Not open for further replies.

rathna01

Programmer
Jun 3, 2003
12
US
Hi All,
Please help in fixing the Daylight Saving.
Here is my query for Eastern Time.
SELECT
a.callingPartyNumber,
a.finalCalledPartyNumber,
a.originalCalledPartyNumber,
dateadd(second,ISNULL((a.dateTimeOrigination-18000),a.dateTimeOrigination),'19700101 00:00:00') as Originated,
dateadd(second,ISNULL((a.dateTimeConnect-18000),a.dateTimeConnect),'19700101 00:00:00') as Connected,
dateadd(second,ISNULL((a.dateTimeDisconnect-18000),a.dateTimeDisconnect),'19700101 00:00:00') as Disconnected,
FROM
dbo.CallDetailRecord a
WHERE
dateadd(second,a.dateTimeOrigination-18000,'19700101 00:00:00') between :StartDate and :EndDate

Thanks
 
What exactly do you mean by:
"Please help in fixing the Daylight Saving."

Are you looking for a script that will automatically change the time for Daylight Savings Time? If so, I don't think you will find one. DST doesn't change on the same date each year. It changes on a specific Sunday in April each year. I think it's the first Sunday at 2 A.M.

I currently keep a list of scripts that depend on time and manually change them. Otherwise I would need four copies of each script - one for non-DST, one for DST, one for when the start date is non-DST and end date is DST, and lastly one for when start date is DST and the end date is non-DST.


-SQLBill
 
select GETUTCDATE() - GMT
select getdate() - Local time (daylight adjusted)

we use a function that look to see if our date is 6 hours diff or 5 hours -- If the answer is 5 then it is daylight savings time...

Proc could look something like (doesn't work in SQL 7)

Create proc DaylightSavings
@daylight bit output
as
declare @d int
select @d = datediff(hh,getdate(),getutcdate())
if @d = 5
begin
set @daylight = 1
end
else
begin
set @daylight=0
end
 
Hi,

I try to execute the getutcdate() function it dont work...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top