Tuesday, October 27, 2009

How to Find Time Difference in VB 6

Private Sub gettimediff()
Dim m_time1 As String
Dim m_time2 As String
Dim m_diff As String
m_time1 = Format(Now, "hh:mm:ss")
m_time2 = DateAdd("h", 1, Format(Now, "hh:mm:ss"))
m_timediff = CStr(DateTime.DateDiff("H", m_time1, m_time2)) + "-" + CStr(DateTime.DateDiff("m", m_time1, m_time2)) + "-" + CStr(DateTime.DateDiff("s", m_time1, m_time2))
End Sub

Monday, October 12, 2009

TOUGH SQL QUESTION INTERVIEW QUESTION

What is the difference between group by and order by?
Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement.