Predmet:Re: Queries vece manje
Evo procedura malo prepravljena.
Pobrisi staru pa stavi ovu:
PreuzmiIzvorni kôd (Visual Basic):Function Ugao(IDL As Integer, IDT As Integer, Optional Kontra As Boolean)
Dim Dx As Double
Dim DY As Double
Dim U As Double
Dim K As Boolean
Kor Dx, DY, IDL, IDT, K
If K = False Then GoTo Kraj
If Dx = 0 Or DY = 0 Then GoTo Kraj
U = Atn(Abs(DY) / Abs(Dx))
If Dx < 0 Then
If DY < 0 Then
U = Abs(U) + PI
Else
U = PI - Abs(U)
End If
Else
If DY < 0 Then
U = (2 * PI) - Abs(U)
End If
End If
U = RadDeg(U)
If Kontra = True Then
If U > 180 Then
U = U - 180
ElseIf Ugao < 180 Then
U = U + 180
End If
End If
Ugao = Format(U, "0.00")
Kraj:
End Function
Evo ti Query Q_Tacke:
PreuzmiIzvorni kôd (SQL):SELECT ugao([LokacijaID],[Tacka]) AS Azimut, Duzina([LokacijaID],[Tacka]) AS Duzina, Ugao([LokacijaID],[Tacka],-1) AS KontraAzimut, *
FROM T_Tacke;
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.