Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old September 30th, 2005, 01:03 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok,

if the calendar date = 01/01/2005, is the month name January?

Kevin

dartcoach
Reply With Quote
  #22 (permalink)  
Old September 30th, 2005, 01:04 PM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

that is correct.

Dharmesh Bhavsar
Reply With Quote
  #23 (permalink)  
Old September 30th, 2005, 01:09 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok,

Change this line in the Extrusion Report Query:

HAVING (((Calendar.Month)=[Enter Month Name]))

to

HAVING (Datepart("m",Calendar.Date) = Datepart("m",Date()))

Kevin



dartcoach
Reply With Quote
  #24 (permalink)  
Old September 30th, 2005, 01:14 PM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

In the sql?


Dharmesh Bhavsar
Reply With Quote
  #25 (permalink)  
Old September 30th, 2005, 01:17 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes.
Make a backup of Extrusion Report Query, call it Extrusion Report Query1.
Then change the line in the sql as I showed you.

Then run your report.

Kevin

dartcoach
Reply With Quote
  #26 (permalink)  
Old September 30th, 2005, 01:19 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Dharmesh,

Make sure you change the sql in the original Extrusion Report Query, not the backup.

Kevin

dartcoach
Reply With Quote
  #27 (permalink)  
Old September 30th, 2005, 01:22 PM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

IT gives an error "You tried to execute a query that does not include specified expression "Your code" as a part of an aggregate function."

Dharmesh Bhavsar
Reply With Quote
  #28 (permalink)  
Old September 30th, 2005, 01:24 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Send me the new sql.

Kevin

dartcoach
Reply With Quote
  #29 (permalink)  
Old September 30th, 2005, 01:28 PM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

Do I need to get rid of the parameter maybe, then try it?

SELECT [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].[Operator Id], [Extrusion Report].DownTimeList, [Extrusion Report].Minutes, ([Minutes]/60) AS [Total Hours], [Extrusion DT Log].[Category 1], [Extrusion DT Log].[Category 2], Calendar.Month
FROM [Extrusion DT Log] INNER JOIN (Calendar INNER JOIN [Extrusion Report] ON Calendar.Date = [Extrusion Report].Date) ON [Extrusion DT Log].[Extrusion DT Id] = [Extrusion Report].DownTimeList
GROUP BY [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].[Operator Id], [Extrusion Report].DownTimeList, [Extrusion Report].Minutes, [Extrusion DT Log].[Category 1], [Extrusion DT Log].[Category 2], Calendar.Month
HAVING (Datepart("m",Calendar.Date) = Datepart("m",Date()))
ORDER BY [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].DownTimeList;

Dharmesh Bhavsar
Reply With Quote
  #30 (permalink)  
Old September 30th, 2005, 01:33 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Dharmesh,

Copy and paste this:

SELECT [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].[Operator Id], [Extrusion Report].DownTimeList, [Extrusion Report].Minutes, ([Minutes]/60) AS [Total Hours], [Extrusion DT Log].[Category 1], [Extrusion DT Log].[Category 2], Calendar.Date, Calendar.Month
FROM [Extrusion DT Log] INNER JOIN (Calendar INNER JOIN [Extrusion Report] ON Calendar.Date = [Extrusion Report].Date) ON [Extrusion DT Log].[Extrusion DT Id] = [Extrusion Report].DownTimeList
GROUP BY [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].[Operator Id], [Extrusion Report].DownTimeList, [Extrusion Report].Minutes, [Extrusion DT Log].[Category 1], [Extrusion DT Log].[Category 2], Calendar.Month
WHERE (Datepart("m",Calendar.Date) = Datepart("m",Date()))
ORDER BY [Extrusion Report].Date, [Extrusion Report].[Line#], [Extrusion Report].[Shift#], [Extrusion Report].DownTimeList;


Let me know.

Kevin


dartcoach
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting month name to month number kalyanykk SQL Server 2005 7 August 19th, 2008 10:37 PM
month calendar bschleusner C# 2005 0 April 13th, 2007 09:46 PM
query Current Month, Month+1, Month+2, Month+3 anterior Access 2 September 24th, 2006 08:25 PM
get current month cathiec SQL Language 2 February 23rd, 2006 09:58 AM
Getting the current month Regornil JSP Basics 1 July 19th, 2004 09:01 PM



All times are GMT -4. The time now is 07:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.