R
reportyemi
I have a report in which i have obtained the sum of some fields i had
created. I was able to get what the sum is for previous month.
I now want to include the result from another field from table
tblmaternal. The field is called parity and has 0,1,2,3,4,5,>5 and i choose
one of these numbers in my form. What i want in my report is the total number
of "0" result and the total number of all the rest , that is anything greater
than "0"
my sql is below
SELECT tblinfantone.delivery_method, Count(tblinfantone.delivery_method) AS
theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.delivery_method
UNION ALL SELECT tblInfantOne.sex, Count(sex) AS theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.sex;
UNION ALL
SELECT tblInfantOne.Conditon_of_babies, Count(Conditon_of_babies) AS theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.Conditon_of_babies
UNION ALL SELECT tblInfantOne.Number_of_babies, Count(Number_of_babies) AS
theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.Number_of_babies;
thanks
created. I was able to get what the sum is for previous month.
I now want to include the result from another field from table
tblmaternal. The field is called parity and has 0,1,2,3,4,5,>5 and i choose
one of these numbers in my form. What i want in my report is the total number
of "0" result and the total number of all the rest , that is anything greater
than "0"
my sql is below
SELECT tblinfantone.delivery_method, Count(tblinfantone.delivery_method) AS
theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.delivery_method
UNION ALL SELECT tblInfantOne.sex, Count(sex) AS theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.sex;
UNION ALL
SELECT tblInfantOne.Conditon_of_babies, Count(Conditon_of_babies) AS theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.Conditon_of_babies
UNION ALL SELECT tblInfantOne.Number_of_babies, Count(Number_of_babies) AS
theCount
FROM tblinfantone
WHERE Date_of_Birth Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)
GROUP BY tblinfantone.Number_of_babies;
thanks