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)
fwstealerAsked:
Who is Participating?
 
mastooCommented:
If this isn't a trick question then yes, that seems fine.
0
 
fwstealerAuthor Commented:
i wish - no I just sux at sql :-)
0
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.