Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Crystal Report

Author  Topic 

shers
Starting Member

3 Posts

Posted - 2004-07-10 : 09:40:51
I have 2 tables in Access. I use VB to view a report in Crystal Report.

Table1: StaffMaster

EmpCode
EmpName

Table2: StaffHrs

EmpCode
Rfs
Project
Month_Year
ATH

I wish to display a report in Crystal Report as follows:

EmpCode | EmpName | Rfs | Prject | Month_Year | ATH

How do I accomplish this? Can this be done using crosstab query?

The criteria is for Month_Year. I tried using Crosstab query, but I have problems with the date format. The date should be displayed on the report as mmmm yyyy format. Can it be done using the following query?

"SELECT StaffMaster.EmpCode, StaffMaster.EmpName, StaffHrs.RFS, StaffHrs.Project, StaffHrs.Month_Year, " & _
"StaffHrs.ATH FROM StaffMaster LEFT OUTER JOIN StaffHrs ON StaffMaster.EmpCode=StaffHrs.EmpCode " & _
"WHERE StaffMaster.EmpCode=StaffHrs.EmpCode AND StaffMaster.Discipline='Architecture' AND " & _
"StaffHrs.Month_Year BETWEEN #July 2004# AND #September 2004#"

If so, how will I display the fields in the appropriate places?

Thanks

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-10 : 10:30:27
How is your date displayed in that table? Is it "July 2004" for example in the table?

Also, you need to make this a stored procedure and get rid of all the dynamic SQL.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -