get dates

what's the best way to meet the following?

end date is now - 6hrs
start date is end date - 48hrs

Does this seem right?

declare @startDate as datetime
declare @endDate as datetime

Set @endDate = dateadd(hh,-6,getdate())
Set @startDate =  dateadd(hh,-48,@endDate)
Who is Participating?
If this isn't a trick question then yes, that seems fine.
fwstealerAuthor Commented:
i wish - no I just sux at sql :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.