neu
This commit is contained in:
@@ -21,9 +21,10 @@ Public Class usrctlStatVERIMEX
|
||||
Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,count(*) as Sendungen ,count(distinct(avisoid)) as LKW
|
||||
FROM [tblSendungen] inner join Aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbklaerungTR_MA
|
||||
" & innerJoinFiliale & "
|
||||
where cast(Datum as date) BETWEEN '" & datStatVon.Value & "' and '" & datStatBis.Value & "' and tblSnd_AbklaerungTR_MA is not null
|
||||
where cast(tblSnd_AbklaerungTR as date) BETWEEN '" & datStatVon.Value & "' and '" & datStatBis.Value & "' and tblSnd_AbklaerungTR_MA is not null
|
||||
" & whereFiliale & "
|
||||
group by mit_vname,mit_nname"
|
||||
'früher: Datum statt tblSnd_AbklaerungTR
|
||||
|
||||
dgvAbklaerungTR.DataSource = SQL.loadDgvBySql(sqlstr, "AVISO")
|
||||
|
||||
@@ -122,4 +123,37 @@ Public Class usrctlStatVERIMEX
|
||||
init()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
|
||||
Try
|
||||
|
||||
|
||||
Dim whereFiliale = ""
|
||||
Dim innerJoinFiliale = ""
|
||||
Select Case cboFirma._value
|
||||
Case ""
|
||||
Case 0 : whereFiliale = " and tblSendungen.FilialenNr <=0 "
|
||||
Case Else
|
||||
whereFiliale = " and Filialen.Firma='" & cboFirma._value & "' "
|
||||
innerJoinFiliale = "inner join " & VERAG_PROG_ALLGEMEIN.cAllgemein.FMZOLL_SERVER & ".VERAG.dbo.Filialen on [tblSendungen].FilialenNr=Filialen.FilialenNr"
|
||||
End Select
|
||||
|
||||
|
||||
Dim sqlstr = "SELECT (Select isnull(Filialen.firma,'') FROM [FMZOLL\SQLFMZOLL].VERAG.dbo.Filialen WHERE [tblSendungen].FilialenNr=Filialen.FilialenNr) Firma,
|
||||
mit_vname + ' ' + mit_nname as Mitarbeiter, aviso.LKW_Nr [LKW Kennzeichen],tblSnd_AvisoID [LKW-ID], Auftraggeber as Avisierer, Frächter, tblSnd_Empfaenger as Empfänger, tblSnd_Colli Colli, tblSnd_Gewicht Gewicht, tblSnd_Abfertigungsart_ID Abfertigungsart, tblSendungen.FilialenNr , tblSendungen.AbfertigungsNr, replace(Ankunft,'1899-12-30 00:00:00','') Ankunft, replace(Freigabe,'1899-12-30 00:00:00','') Freigabe
|
||||
FROM [tblSendungen] inner join Aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbklaerungTR_MA
|
||||
" & innerJoinFiliale & "
|
||||
where cast(tblSnd_AbklaerungTR as date) BETWEEN '" & datStatVon.Value & "' and '" & datStatBis.Value & "' and tblSnd_AbklaerungTR_MA is not null
|
||||
" & whereFiliale & "
|
||||
ORDER BY Firma, Mitarbeiter,Auftraggeber,LKW_Nr,tblSnd_PosUnterNr"
|
||||
|
||||
SDL.cProgramFunctions.genExcelFromDT_NEW(SQL.loadDgvBySql(sqlstr, "AVISO"))
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user