AccessHelp123
Programmer
Hi all,
I have a query that looks like this. I have been struggling to write something that will modify the query as per written below. Thanks a lot.
INSERT INTO Table1 ( [Date], DCR )
SELECT tableData.Date, tableData.LostCalls AS DCR
FROM tableData
WHERE (((tableData.Date) Between [Forms]![frmGraph]![cmbStartDate] And [Forms]![frmGraph]![cmbEndDate]) AND ((tableData.SiteName)=[Forms]![frmGraph]![ListSiteName]))
GROUP BY tableData.Date, tableData.LostCalls;
This gives me two columns in Table1 with Date and DCR from tableData where SiteName is from a listbox ListSiteName
Table1
Date | DCR
04/12/2005 | 2.3345
04/12/2005 | 2.4356
04/12/2005 | 2.3454
04/13/2005 | 3.344
04/13/2005 | 2.334
04/13/2005 | 2.98797
For each Date in tableData the SiteName is listed three times with an entry in ajdacent column (tableData.Sector) as 0,1,2.
tableData
Date | DCR | SiteName | Sector
04/12/2005 | 2.3345 | Test123 | 0
04/12/2005 | 2.4356 | Test123 | 1
04/12/2005 | 2.3454 | Test123 | 2
04/13/2005 | 3.344 | Test123 | 0
04/13/2005 | 2.334 | Test123 | 1
04/13/2005 | 2.98797 | Test123 | 2
I am struggling to write a query that gives me
Date, Dcr for SiteName(Sector0), Dcr for SiteName(Sector1), Dcr for SiteName(Sector2)
So query I am trying to write should give me.
Table1
Date | DCR(Sector 0) | DCR(Sector 1) | DCR(Sector 1)
04/12/2005 | 2.3345 | 2.4356 | 2.3454
04/13/2005 | 3.344 | 2.334 | 2.98797
Please let me know how to go about this. Thanks.
I have a query that looks like this. I have been struggling to write something that will modify the query as per written below. Thanks a lot.
INSERT INTO Table1 ( [Date], DCR )
SELECT tableData.Date, tableData.LostCalls AS DCR
FROM tableData
WHERE (((tableData.Date) Between [Forms]![frmGraph]![cmbStartDate] And [Forms]![frmGraph]![cmbEndDate]) AND ((tableData.SiteName)=[Forms]![frmGraph]![ListSiteName]))
GROUP BY tableData.Date, tableData.LostCalls;
This gives me two columns in Table1 with Date and DCR from tableData where SiteName is from a listbox ListSiteName
Table1
Date | DCR
04/12/2005 | 2.3345
04/12/2005 | 2.4356
04/12/2005 | 2.3454
04/13/2005 | 3.344
04/13/2005 | 2.334
04/13/2005 | 2.98797
For each Date in tableData the SiteName is listed three times with an entry in ajdacent column (tableData.Sector) as 0,1,2.
tableData
Date | DCR | SiteName | Sector
04/12/2005 | 2.3345 | Test123 | 0
04/12/2005 | 2.4356 | Test123 | 1
04/12/2005 | 2.3454 | Test123 | 2
04/13/2005 | 3.344 | Test123 | 0
04/13/2005 | 2.334 | Test123 | 1
04/13/2005 | 2.98797 | Test123 | 2
I am struggling to write a query that gives me
Date, Dcr for SiteName(Sector0), Dcr for SiteName(Sector1), Dcr for SiteName(Sector2)
So query I am trying to write should give me.
Table1
Date | DCR(Sector 0) | DCR(Sector 1) | DCR(Sector 1)
04/12/2005 | 2.3345 | 2.4356 | 2.3454
04/13/2005 | 3.344 | 2.334 | 2.98797
Please let me know how to go about this. Thanks.