Thanks Dough for your willingness to help me. This is the entire query. What
I did on each dates on the criteria and OR row, I put the filter of the
form. so that once I filter the rage of date in the form, it will show up the
name. But the problem is it seem the OR function does not work.
Here is the query in sql view:
SELECT bukuangkby.FNAME, bukuangkby.MNAME, bukuangkby.LNAME, [FNAME] & " " &
[MNAME] & " " & [LNAME] AS NamaFull, bukuangkby.JenisKel,
bukuangkby.TGLLAHIR, bukuangkby.TGLBPTIS_M, bukuangkby.TGL_pen,
bukuangkby.ATSPERCA_M, bukuangkby.ATSSUR1_K, bukuangkby.ATSSUR2_K,
bukuangkby.KMATIAN_K, bukuangkby.KELMURT_K, bukuangkby.KELHILA_K,
bukuangkby.Tgl_Nikah
FROM bukuangkby
WHERE (((bukuangkby.Tgl_Nikah) Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate] And [Forms]![frmReportDates_All
DateEvents]![txtEndDate])) OR (((bukuangkby.TGLLAHIR) Between
[Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]) AND
((bukuangkby.TGLBPTIS_M) Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate] And [Forms]![frmReportDates_All
DateEvents]![txtEndDate]) AND ((bukuangkby.TGL_pen) Between
[Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]) AND
((bukuangkby.ATSPERCA_M) Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate] And [Forms]![frmReportDates_All
DateEvents]![txtEndDate]) AND ((bukuangkby.ATSSUR1_K) Between
[Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]) AND
((bukuangkby.ATSSUR2_K) Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate] And [Forms]![frmReportDates_All
DateEvents]![txtEndDate]) AND ((bukuangkby.KMATIAN_K) Between
[Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]) AND
((bukuangkby.KELMURT_K) Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate] And [Forms]![frmReportDates_All
DateEvents]![txtEndDate]) AND ((bukuangkby.KELHILA_K) Between
[Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]));
Thanks in advance
--
H. Frank Situmorang
Douglas J. Steele said:
What's the entire SQL of your query?
Incidentally, First is seldom useful...
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Frank Situmorang said:
Thanks Dough for your explanation, but when I tried it there is a syntax
error says: "3075 Syantax error in query expression
'First([Sum(IIf([TGLLahir] BETWEEN [Forms]![frmReportDates_All
DateEvents]![txtBegDate] AND
[Forms]![frmReportDates_All DateEvents]![txtEndDate], 1, 0))])'.
Can you help me again?. For your information the report is based on a
quiry
on each coulum of dates, I have a Criteria: BETWEEN
[Forms]![frmReportDates_All
DateEvents]![txtBegDate] AND
[Forms]![frmReportDates_All DateEvents]![txtEndDate]
Thanks in advance
H. Frank Situmorang
Douglas J. Steele said:
While it may seem counterintuitive, the solution is to use Sum, not
Count:
Sum(dIIf([DateofBirth] BETWEEN [Forms]![frmReportDates_All
DateEvents]![txtBegDate] AND
[Forms]![frmReportDates_All DateEvents]![txtEndDate], 1, 0))
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hello,
I tried to have a report to show the events in our church. since Union
Query
is too complicated to my understanding, so I use Select Query and on
each
date event ( Birth, marriage, death etc) I use a filter by Form. with
the
criteria in the dates field:
Between [Forms]![frmReportDates_All DateEvents]![txtBegDate] And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]
However Although I filter only for Feb for example, all the dates of
birth
is still shown on the report. When I want to count each column, the
result
will be misleading ( is not waht we wantted). My question is how can we
make
a formula to be able to count only what we want. Can we make: = Count(
Date
of Birth) IF(Between [Forms]![frmReportDates_All
DateEvents]![txtBegDate]
And
[Forms]![frmReportDates_All DateEvents]![txtEndDate]).
Something like that?
I appreciate your help