473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Need report help

vs2k8
13
Hello guys,

My report is based on below query:
Expand|Select|Wrap|Line Numbers
  1. SELECT Log_Tbl.DocType, Log_Tbl.DocGroup, Count(Nz([Log_Tbl].[PName],1)) AS TotPname, Count([EDes_Tbl.ELogType] & [EDes_Tbl.ELogName]) AS ECounts
  2. FROM Log_Tbl LEFT JOIN EDes_Tbl ON Log_Tbl.IdNum = EDes_Tbl.IdNum
  3. GROUP BY Log_Tbl.DocType, Log_Tbl.DocGroup
  4. HAVING (((Log_Tbl.DocType) Is Not Null));
User wants to run this report every quarterly(Q1: 01-Jan-08 to 31-Mar-08,Q2 :01-Apr-08 to 30-Jun-08 Q3:01-Jul-08 to 30-Sep-08 and Q4: 01-Oct-08 to 31-Dec-08.) and yearly too.Log_Tbl.Log_Dt is the date to be queried.
Now i want when I hit the report button it will ask user to enter the parameter for Q1,Q2,Q3,Q4,yearly and I get results for that particular quarter.

So can anyone help me how to achieve this , how I should proceed.

Thanks in advance.

-V
Aug 6 '08 #1
5 1314
NeoPa
32,556 Expert Mod 16PB
I've tidied up the SQL for display (and easy understand) purposes, yet I cannot see anything here which can relate to dates. I'm completely at a loss as to what you're hoping to achieve.
Expand|Select|Wrap|Line Numbers
  1. SELECT Log_Tbl.DocType,
  2.        Log_Tbl.DocGroup,
  3.        Count(Nz([Log_Tbl].[PName],1)) AS TotPname,
  4.        Count([EDes_Tbl.ELogType] & [EDes_Tbl.ELogName]) AS ECounts
  5.  
  6. FROM Log_Tbl LEFT JOIN EDes_Tbl
  7.   ON Log_Tbl.IdNum = EDes_Tbl.IdNum
  8.  
  9. WHERE (Log_Tbl.DocType Is Not Null)
  10.  
  11. GROUP BY Log_Tbl.DocType,
  12.          Log_Tbl.DocGroup
Aug 6 '08 #2
vs2k8
13
Thanks for your reply and making query look better, sorry that you can't get my question,
Expand|Select|Wrap|Line Numbers
  1. SELECT Log_Tbl.DocType,
  2.        Log_Tbl.DocGroup,
  3.        Count(Nz([Log_Tbl].[PName],1)) AS TotPname,
  4.        Count([EDes_Tbl.ELogType] & [EDes_Tbl.ELogName]) AS ECounts
  5.  
  6. FROM Log_Tbl LEFT JOIN EDes_Tbl
  7.   ON Log_Tbl.IdNum = EDes_Tbl.IdNum
  8.  
  9. WHERE ((Log_Tbl.DocType Is Not Null)
  10.   AND (Log_Tbl.Log_Dt Between [From_Date] and [To_Date]))
  11.  
  12. GROUP BY Log_Tbl.DocType,
  13.          Log_Tbl.DocGroup
I added in the where clause a code as you can see above, but instead of passing date in From_Date & To_Date
** Admin Edit ** All code added in [ CODE ] tags as this is a requirement AND it's impossible to make much sense of otherwise ** /Admin Edit **
is there any way user enters Q1 or Q2 or Q3 or Q4 and year and he gets report for that quarter and year
for e.g if he enters Q1 and 2008 report will run for 01-Jan-2008 to 31-Mar-2008.

Hope this will clear the picture what I want to achieve.

Thanks in advance.

-V
Aug 6 '08 #3
NeoPa
32,556 Expert Mod 16PB
Well, doctoring the SQL would be easy enough, but as you say the report has to run from this (I'm assuming the SQL is in a QueryDef object - or saved query) then I would suggest that applying a filter to the report when it is opened (from code in your form obviously) would be the way to go. As the filter would have to be applied to the field [Log_Dt], this field must necessarily be available as a SELECTed field in the QueryDef (so will need to be added - even if it is not used elsewhere in the report).

Does this sound like a solution?
Aug 6 '08 #4
vs2k8
13
Thanks for your solution.

-V
Aug 6 '08 #5
NeoPa
32,556 Expert Mod 16PB
Pleased to hear it suits.

Let us know if you need further help implementing it.
Aug 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: CSDunn | last post by:
Hello, I have a situation in which each record on a report has 40 fields, any one of which can contain a value of 'C', or 'I', or 'B'. I need to create one calculated field on the report that will...
3
by: CSDunn | last post by:
Hello, I have 14 fields on a report that hold integer values. The field names use the following naming convention: T1Number, T2Number ....T14Number. I need to get a 'sub total' of all fields as...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
7
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
2
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database...
7
by: themastertaylor | last post by:
Hi, I work for a construction company and part of my job is sourcing materials. currently we have a spreadsheet based system whereby each site has a worksheet in the workbook with the standard...
4
by: access baby | last post by:
i have a huge database based on date and time need to create different report we need to measure our work processes how many order received , order cancelled, completed and count of items completed...
5
by: LadyIlsebet | last post by:
I'm not a fantastic Access developer, but I'm trying to help get Inventory and whatnot organized at work. They are used to 5 year budget plans that list out exactly what has to be purchased what...
0
by: akshaycjoshi | last post by:
Most of you people are already familier with the working of crystal reports unlike me.I am working on an application when I have no other option but to use CR. It is very diff. for me to read an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.