Article View: pl.comp.bazy-danych.msaccess
Article #137637Re: Grupowanie danych do wiersza
From: LeszekN
Date: Fri, 15 Feb 2019 20:16
Date: Fri, 15 Feb 2019 20:16
54 lines
2717 bytes
2717 bytes
Co to znaczy f: a, a, a, a, a, a, a, a, a, a, a, a ??
odpowiedz 1
Sumowanie wybranych rekordów z jednej kolumny do wiersza
Wystarczy wywołać DsumText w pętli dla danych rekordów które chcemy sumować do jednego wiersza
w raporcie w Źródło Formantu
DSumText("NazwaKolumnyTabeli", "NazwaTabeli", "KtoryRekordTabeli=1")
Funkcja popełniona przez KN - (Krzystof Noworyta)
w module
Function DSumText(sField As String, _
sTable As String, _
Optional sWhere As String, _
Optional sSep As String = ",") As Variant
Dim strSQL As String
Dim Kon As String
strSQL = "Select " & sField & " FROM " & sTable
If Len(sWhere) > 0 Then
strSQL = strSQL & " WHERE " & sWhere
End If
On Error GoTo err_exit
With CurrentDb.OpenRecordset(strSQL, 4)
Do Until .EOF
Kon = Kon & sSep & .Fields(0).Value
.MoveNext
Loop
.Close
End With
Kon = Mid(Kon, Len(sSep) + 1)
DSumText = Kon
Exit Function
err_exit:
Set DSumText = Err
End Function
odpowiedz 2
jeżeli chodzi o sumę z kilku kolumn w jedną
w raporcie w Źródło Formantu
="/" & [kolumna1] & ", " & [Kolumna2] & ", " & [kolumna3]
------
Leszek
Technical Details
Message-ID:
<3a873f26-a5d2-45ab-a812-94591ee5e92c@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!m21no6127864qta.0!news-out.google.com!q39ni829qtk.1!nntp.google.com!m21no6127854qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<f41a2577-b3f2-4321-9bcb-6ec5248cce52@googlegroups.com>Show Full Headers
Complete Article Headers
X-Received: by 2002:a37:a616:: with SMTP id p22mr6215707qke.24.1550261817224; Fri, 15 Feb 2019 12:16:57 -0800 (PST) X-Received: by 2002:a0c:f705:: with SMTP id w5mr64746qvn.3.1550261816918; Fri, 15 Feb 2019 12:16:56 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!m21no6127864qta.0!news-out.google.com!q39ni829qtk.1!nntp.google.com!m21no6127854qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.bazy-danych.msaccess Date: Fri, 15 Feb 2019 12:16:56 -0800 (PST) In-Reply-To: <f41a2577-b3f2-4321-9bcb-6ec5248cce52@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.41.128.7; posting-account=i0RtOwoAAABRI8EWUf_BQOpbS6yj4J_N NNTP-Posting-Host: 185.41.128.7 References: <f41a2577-b3f2-4321-9bcb-6ec5248cce52@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3a873f26-a5d2-45ab-a812-94591ee5e92c@googlegroups.com> Subject: Re: Grupowanie danych do wiersza From: LeszekN <leszeknowak@wp.pl> Injection-Date: Fri, 15 Feb 2019 20:16:57 +0000 X-Received-Bytes: 2658 X-Received-Body-CRC: 3616361417 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit