Tigger9969
Programmer
Can anyone help with create a query for sql 2000.
Here's a sample of what I'm trying to output.
employee Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec
emp1 sum of amount for each month
" "
then use crystal reports to sum each much, and calculate a acumulative sum.
The query looked like this in Access, but I'm having no luck in sql 2000.
TRANSFORM Sum(Entries.Downtime) AS [The Value]
SELECT Entries.OPID, Entries.Machine, Sum(Entries.Downtime) AS [Total Of Downtime]
FROM Entries
WHERE (((Entries.Machine)=[Forms]![fm_Report_selection]![machinetxt]) AND ((Entries.Date)<[forms]![fm_report_selection]![text55]))
GROUP BY Entries.OPID, Entries.Machine, Entries.Date
PIVOT Format([Date],"mmm" In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
Any help would be appreciated.
Tigger9969
Here's a sample of what I'm trying to output.
employee Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec
emp1 sum of amount for each month
" "
then use crystal reports to sum each much, and calculate a acumulative sum.
The query looked like this in Access, but I'm having no luck in sql 2000.
TRANSFORM Sum(Entries.Downtime) AS [The Value]
SELECT Entries.OPID, Entries.Machine, Sum(Entries.Downtime) AS [Total Of Downtime]
FROM Entries
WHERE (((Entries.Machine)=[Forms]![fm_Report_selection]![machinetxt]) AND ((Entries.Date)<[forms]![fm_report_selection]![text55]))
GROUP BY Entries.OPID, Entries.Machine, Entries.Date
PIVOT Format([Date],"mmm" In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
Any help would be appreciated.
Tigger9969